pinctrl-atlas7.c 145 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638
  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. struct dt_params {
  132. const char *property;
  133. int value;
  134. };
  135. /**
  136. * struct atlas7_pad_conf - Atlas7 Pad Configuration
  137. * @id The ID of this Pad.
  138. * @type: The type of this Pad.
  139. * @mux_reg: The mux register offset.
  140. * This register contains the mux.
  141. * @pupd_reg: The pull-up/down register offset.
  142. * @drvstr_reg: The drive-strength register offset.
  143. * @ad_ctrl_reg: The Analogue/Digital Control register.
  144. *
  145. * @mux_bit: The start bit of mux register.
  146. * @pupd_bit: The start bit of pull-up/down register.
  147. * @drvstr_bit: The start bit of drive-strength register.
  148. * @ad_ctrl_bit: The start bit of analogue/digital register.
  149. */
  150. struct atlas7_pad_config {
  151. const u32 id;
  152. u32 type;
  153. u32 mux_reg;
  154. u32 pupd_reg;
  155. u32 drvstr_reg;
  156. u32 ad_ctrl_reg;
  157. /* bits in register */
  158. u8 mux_bit;
  159. u8 pupd_bit;
  160. u8 drvstr_bit;
  161. u8 ad_ctrl_bit;
  162. };
  163. #define PADCONF(pad, t, mr, pr, dsr, adr, mb, pb, dsb, adb) \
  164. { \
  165. .id = pad, \
  166. .type = t, \
  167. .mux_reg = mr, \
  168. .pupd_reg = pr, \
  169. .drvstr_reg = dsr, \
  170. .ad_ctrl_reg = adr, \
  171. .mux_bit = mb, \
  172. .pupd_bit = pb, \
  173. .drvstr_bit = dsb, \
  174. .ad_ctrl_bit = adb, \
  175. }
  176. /**
  177. * struct atlas7_pad_mux - Atlas7 mux
  178. * @bank: The bank of this pad's registers on.
  179. * @pin : The ID of this Pad.
  180. * @func: The mux func on this Pad.
  181. * @dinput_reg: The Input-Disable register offset.
  182. * @dinput_bit: The start bit of Input-Disable register.
  183. * @dinput_val_reg: The Input-Disable-value register offset.
  184. * This register is used to set the value of this pad
  185. * if this pad was disabled.
  186. * @dinput_val_bit: The start bit of Input-Disable Value register.
  187. */
  188. struct atlas7_pad_mux {
  189. u32 bank;
  190. u32 pin;
  191. u32 func;
  192. u32 dinput_reg;
  193. u32 dinput_bit;
  194. u32 dinput_val_reg;
  195. u32 dinput_val_bit;
  196. };
  197. #define MUX(b, pad, f, dr, db, dvr, dvb) \
  198. { \
  199. .bank = b, \
  200. .pin = pad, \
  201. .func = f, \
  202. .dinput_reg = dr, \
  203. .dinput_bit = db, \
  204. .dinput_val_reg = dvr, \
  205. .dinput_val_bit = dvb, \
  206. }
  207. struct atlas7_grp_mux {
  208. unsigned int group;
  209. unsigned int pad_mux_count;
  210. const struct atlas7_pad_mux *pad_mux_list;
  211. };
  212. /**
  213. * struct sirfsoc_pin_group - describes a SiRFprimaII pin group
  214. * @name: the name of this specific pin group
  215. * @pins: an array of discrete physical pins used in this group, taken
  216. * from the driver-local pin enumeration space
  217. * @num_pins: the number of pins in this group array, i.e. the number of
  218. * elements in .pins so we can iterate over that array
  219. */
  220. struct atlas7_pin_group {
  221. const char *name;
  222. const unsigned int *pins;
  223. const unsigned num_pins;
  224. };
  225. #define GROUP(n, p) \
  226. { \
  227. .name = n, \
  228. .pins = p, \
  229. .num_pins = ARRAY_SIZE(p), \
  230. }
  231. struct atlas7_pmx_func {
  232. const char *name;
  233. const char * const *groups;
  234. const unsigned num_groups;
  235. const struct atlas7_grp_mux *grpmux;
  236. };
  237. #define FUNCTION(n, g, m) \
  238. { \
  239. .name = n, \
  240. .groups = g, \
  241. .num_groups = ARRAY_SIZE(g), \
  242. .grpmux = m, \
  243. }
  244. struct atlas7_pinctrl_data {
  245. struct pinctrl_pin_desc *pads;
  246. int pads_cnt;
  247. struct atlas7_pin_group *grps;
  248. int grps_cnt;
  249. struct atlas7_pmx_func *funcs;
  250. int funcs_cnt;
  251. struct atlas7_pad_config *confs;
  252. int confs_cnt;
  253. };
  254. /* Platform info of atlas7 pinctrl */
  255. #define ATLAS7_PINCTRL_REG_BANKS 2
  256. #define ATLAS7_PINCTRL_BANK_0_PINS 18
  257. /**
  258. * Atlas7 GPIO Chip
  259. */
  260. #define NGPIO_OF_BANK 32
  261. #define GPIO_TO_BANK(gpio) ((gpio) / NGPIO_OF_BANK)
  262. /* Registers of GPIO Controllers */
  263. #define ATLAS7_GPIO_BASE(g, b) ((g)->reg + 0x100 * (b))
  264. #define ATLAS7_GPIO_CTRL(b, i) ((b)->base + 4 * (i))
  265. #define ATLAS7_GPIO_INT_STATUS(b) ((b)->base + 0x8C)
  266. /* Definition bits of GPIO Control Registers */
  267. #define ATLAS7_GPIO_CTL_INTR_LOW_MASK BIT(0)
  268. #define ATLAS7_GPIO_CTL_INTR_HIGH_MASK BIT(1)
  269. #define ATLAS7_GPIO_CTL_INTR_TYPE_MASK BIT(2)
  270. #define ATLAS7_GPIO_CTL_INTR_EN_MASK BIT(3)
  271. #define ATLAS7_GPIO_CTL_INTR_STATUS_MASK BIT(4)
  272. #define ATLAS7_GPIO_CTL_OUT_EN_MASK BIT(5)
  273. #define ATLAS7_GPIO_CTL_DATAOUT_MASK BIT(6)
  274. #define ATLAS7_GPIO_CTL_DATAIN_MASK BIT(7)
  275. struct atlas7_gpio_bank {
  276. struct pinctrl_dev *pctldev;
  277. int id;
  278. int irq;
  279. void __iomem *base;
  280. unsigned int gpio_offset;
  281. unsigned int ngpio;
  282. const unsigned int *gpio_pins;
  283. };
  284. struct atlas7_gpio_chip {
  285. const char *name;
  286. void __iomem *reg;
  287. struct clk *clk;
  288. int nbank;
  289. spinlock_t lock;
  290. struct gpio_chip chip;
  291. struct atlas7_gpio_bank banks[0];
  292. };
  293. static inline struct atlas7_gpio_chip *to_atlas7_gpio(struct gpio_chip *gc)
  294. {
  295. return container_of(gc, struct atlas7_gpio_chip, chip);
  296. }
  297. /**
  298. * @dev: a pointer back to containing device
  299. * @virtbase: the offset to the controller in virtual memory
  300. */
  301. struct atlas7_pmx {
  302. struct device *dev;
  303. struct pinctrl_dev *pctl;
  304. struct pinctrl_desc pctl_desc;
  305. struct atlas7_pinctrl_data *pctl_data;
  306. void __iomem *regs[ATLAS7_PINCTRL_REG_BANKS];
  307. };
  308. /*
  309. * Pad list for the pinmux subsystem
  310. * refer to A7DA IO Summary - CS-314158-DD-4E.xls
  311. */
  312. /*Pads in IOC RTC & TOP */
  313. static const struct pinctrl_pin_desc atlas7_ioc_pads[] = {
  314. /* RTC PADs */
  315. PINCTRL_PIN(0, "rtc_gpio_0"),
  316. PINCTRL_PIN(1, "rtc_gpio_1"),
  317. PINCTRL_PIN(2, "rtc_gpio_2"),
  318. PINCTRL_PIN(3, "rtc_gpio_3"),
  319. PINCTRL_PIN(4, "low_bat_ind_b"),
  320. PINCTRL_PIN(5, "on_key_b"),
  321. PINCTRL_PIN(6, "ext_on"),
  322. PINCTRL_PIN(7, "mem_on"),
  323. PINCTRL_PIN(8, "core_on"),
  324. PINCTRL_PIN(9, "io_on"),
  325. PINCTRL_PIN(10, "can0_tx"),
  326. PINCTRL_PIN(11, "can0_rx"),
  327. PINCTRL_PIN(12, "spi0_clk"),
  328. PINCTRL_PIN(13, "spi0_cs_b"),
  329. PINCTRL_PIN(14, "spi0_io_0"),
  330. PINCTRL_PIN(15, "spi0_io_1"),
  331. PINCTRL_PIN(16, "spi0_io_2"),
  332. PINCTRL_PIN(17, "spi0_io_3"),
  333. /* TOP PADs */
  334. PINCTRL_PIN(18, "spi1_en"),
  335. PINCTRL_PIN(19, "spi1_clk"),
  336. PINCTRL_PIN(20, "spi1_din"),
  337. PINCTRL_PIN(21, "spi1_dout"),
  338. PINCTRL_PIN(22, "trg_spi_clk"),
  339. PINCTRL_PIN(23, "trg_spi_di"),
  340. PINCTRL_PIN(24, "trg_spi_do"),
  341. PINCTRL_PIN(25, "trg_spi_cs_b"),
  342. PINCTRL_PIN(26, "trg_acq_d1"),
  343. PINCTRL_PIN(27, "trg_irq_b"),
  344. PINCTRL_PIN(28, "trg_acq_d0"),
  345. PINCTRL_PIN(29, "trg_acq_clk"),
  346. PINCTRL_PIN(30, "trg_shutdown_b_out"),
  347. PINCTRL_PIN(31, "sdio2_clk"),
  348. PINCTRL_PIN(32, "sdio2_cmd"),
  349. PINCTRL_PIN(33, "sdio2_dat_0"),
  350. PINCTRL_PIN(34, "sdio2_dat_1"),
  351. PINCTRL_PIN(35, "sdio2_dat_2"),
  352. PINCTRL_PIN(36, "sdio2_dat_3"),
  353. PINCTRL_PIN(37, "df_ad_7"),
  354. PINCTRL_PIN(38, "df_ad_6"),
  355. PINCTRL_PIN(39, "df_ad_5"),
  356. PINCTRL_PIN(40, "df_ad_4"),
  357. PINCTRL_PIN(41, "df_ad_3"),
  358. PINCTRL_PIN(42, "df_ad_2"),
  359. PINCTRL_PIN(43, "df_ad_1"),
  360. PINCTRL_PIN(44, "df_ad_0"),
  361. PINCTRL_PIN(45, "df_dqs"),
  362. PINCTRL_PIN(46, "df_cle"),
  363. PINCTRL_PIN(47, "df_ale"),
  364. PINCTRL_PIN(48, "df_we_b"),
  365. PINCTRL_PIN(49, "df_re_b"),
  366. PINCTRL_PIN(50, "df_ry_by"),
  367. PINCTRL_PIN(51, "df_cs_b_1"),
  368. PINCTRL_PIN(52, "df_cs_b_0"),
  369. PINCTRL_PIN(53, "l_pclk"),
  370. PINCTRL_PIN(54, "l_lck"),
  371. PINCTRL_PIN(55, "l_fck"),
  372. PINCTRL_PIN(56, "l_de"),
  373. PINCTRL_PIN(57, "ldd_0"),
  374. PINCTRL_PIN(58, "ldd_1"),
  375. PINCTRL_PIN(59, "ldd_2"),
  376. PINCTRL_PIN(60, "ldd_3"),
  377. PINCTRL_PIN(61, "ldd_4"),
  378. PINCTRL_PIN(62, "ldd_5"),
  379. PINCTRL_PIN(63, "ldd_6"),
  380. PINCTRL_PIN(64, "ldd_7"),
  381. PINCTRL_PIN(65, "ldd_8"),
  382. PINCTRL_PIN(66, "ldd_9"),
  383. PINCTRL_PIN(67, "ldd_10"),
  384. PINCTRL_PIN(68, "ldd_11"),
  385. PINCTRL_PIN(69, "ldd_12"),
  386. PINCTRL_PIN(70, "ldd_13"),
  387. PINCTRL_PIN(71, "ldd_14"),
  388. PINCTRL_PIN(72, "ldd_15"),
  389. PINCTRL_PIN(73, "lcd_gpio_20"),
  390. PINCTRL_PIN(74, "vip_0"),
  391. PINCTRL_PIN(75, "vip_1"),
  392. PINCTRL_PIN(76, "vip_2"),
  393. PINCTRL_PIN(77, "vip_3"),
  394. PINCTRL_PIN(78, "vip_4"),
  395. PINCTRL_PIN(79, "vip_5"),
  396. PINCTRL_PIN(80, "vip_6"),
  397. PINCTRL_PIN(81, "vip_7"),
  398. PINCTRL_PIN(82, "vip_pxclk"),
  399. PINCTRL_PIN(83, "vip_hsync"),
  400. PINCTRL_PIN(84, "vip_vsync"),
  401. PINCTRL_PIN(85, "sdio3_clk"),
  402. PINCTRL_PIN(86, "sdio3_cmd"),
  403. PINCTRL_PIN(87, "sdio3_dat_0"),
  404. PINCTRL_PIN(88, "sdio3_dat_1"),
  405. PINCTRL_PIN(89, "sdio3_dat_2"),
  406. PINCTRL_PIN(90, "sdio3_dat_3"),
  407. PINCTRL_PIN(91, "sdio5_clk"),
  408. PINCTRL_PIN(92, "sdio5_cmd"),
  409. PINCTRL_PIN(93, "sdio5_dat_0"),
  410. PINCTRL_PIN(94, "sdio5_dat_1"),
  411. PINCTRL_PIN(95, "sdio5_dat_2"),
  412. PINCTRL_PIN(96, "sdio5_dat_3"),
  413. PINCTRL_PIN(97, "rgmii_txd_0"),
  414. PINCTRL_PIN(98, "rgmii_txd_1"),
  415. PINCTRL_PIN(99, "rgmii_txd_2"),
  416. PINCTRL_PIN(100, "rgmii_txd_3"),
  417. PINCTRL_PIN(101, "rgmii_txclk"),
  418. PINCTRL_PIN(102, "rgmii_tx_ctl"),
  419. PINCTRL_PIN(103, "rgmii_rxd_0"),
  420. PINCTRL_PIN(104, "rgmii_rxd_1"),
  421. PINCTRL_PIN(105, "rgmii_rxd_2"),
  422. PINCTRL_PIN(106, "rgmii_rxd_3"),
  423. PINCTRL_PIN(107, "rgmii_rx_clk"),
  424. PINCTRL_PIN(108, "rgmii_rxc_ctl"),
  425. PINCTRL_PIN(109, "rgmii_mdio"),
  426. PINCTRL_PIN(110, "rgmii_mdc"),
  427. PINCTRL_PIN(111, "rgmii_intr_n"),
  428. PINCTRL_PIN(112, "i2s_mclk"),
  429. PINCTRL_PIN(113, "i2s_bclk"),
  430. PINCTRL_PIN(114, "i2s_ws"),
  431. PINCTRL_PIN(115, "i2s_dout0"),
  432. PINCTRL_PIN(116, "i2s_dout1"),
  433. PINCTRL_PIN(117, "i2s_dout2"),
  434. PINCTRL_PIN(118, "i2s_din"),
  435. PINCTRL_PIN(119, "gpio_0"),
  436. PINCTRL_PIN(120, "gpio_1"),
  437. PINCTRL_PIN(121, "gpio_2"),
  438. PINCTRL_PIN(122, "gpio_3"),
  439. PINCTRL_PIN(123, "gpio_4"),
  440. PINCTRL_PIN(124, "gpio_5"),
  441. PINCTRL_PIN(125, "gpio_6"),
  442. PINCTRL_PIN(126, "gpio_7"),
  443. PINCTRL_PIN(127, "sda_0"),
  444. PINCTRL_PIN(128, "scl_0"),
  445. PINCTRL_PIN(129, "coex_pio_0"),
  446. PINCTRL_PIN(130, "coex_pio_1"),
  447. PINCTRL_PIN(131, "coex_pio_2"),
  448. PINCTRL_PIN(132, "coex_pio_3"),
  449. PINCTRL_PIN(133, "uart0_tx"),
  450. PINCTRL_PIN(134, "uart0_rx"),
  451. PINCTRL_PIN(135, "uart1_tx"),
  452. PINCTRL_PIN(136, "uart1_rx"),
  453. PINCTRL_PIN(137, "uart3_tx"),
  454. PINCTRL_PIN(138, "uart3_rx"),
  455. PINCTRL_PIN(139, "uart4_tx"),
  456. PINCTRL_PIN(140, "uart4_rx"),
  457. PINCTRL_PIN(141, "usp0_clk"),
  458. PINCTRL_PIN(142, "usp0_tx"),
  459. PINCTRL_PIN(143, "usp0_rx"),
  460. PINCTRL_PIN(144, "usp0_fs"),
  461. PINCTRL_PIN(145, "usp1_clk"),
  462. PINCTRL_PIN(146, "usp1_tx"),
  463. PINCTRL_PIN(147, "usp1_rx"),
  464. PINCTRL_PIN(148, "usp1_fs"),
  465. PINCTRL_PIN(149, "lvds_tx0d4p"),
  466. PINCTRL_PIN(150, "lvds_tx0d4n"),
  467. PINCTRL_PIN(151, "lvds_tx0d3p"),
  468. PINCTRL_PIN(152, "lvds_tx0d3n"),
  469. PINCTRL_PIN(153, "lvds_tx0d2p"),
  470. PINCTRL_PIN(154, "lvds_tx0d2n"),
  471. PINCTRL_PIN(155, "lvds_tx0d1p"),
  472. PINCTRL_PIN(156, "lvds_tx0d1n"),
  473. PINCTRL_PIN(157, "lvds_tx0d0p"),
  474. PINCTRL_PIN(158, "lvds_tx0d0n"),
  475. };
  476. struct atlas7_pad_config atlas7_ioc_pad_confs[] = {
  477. /* The Configuration of IOC_RTC Pads */
  478. PADCONF(0, 3, 0x0, 0x100, 0x200, -1, 0, 0, 0, 0),
  479. PADCONF(1, 3, 0x0, 0x100, 0x200, -1, 4, 2, 2, 0),
  480. PADCONF(2, 3, 0x0, 0x100, 0x200, -1, 8, 4, 4, 0),
  481. PADCONF(3, 5, 0x0, 0x100, 0x200, -1, 12, 6, 6, 0),
  482. PADCONF(4, 4, 0x0, 0x100, 0x200, -1, 16, 8, 8, 0),
  483. PADCONF(5, 4, 0x0, 0x100, 0x200, -1, 20, 10, 10, 0),
  484. PADCONF(6, 3, 0x0, 0x100, 0x200, -1, 24, 12, 12, 0),
  485. PADCONF(7, 3, 0x0, 0x100, 0x200, -1, 28, 14, 14, 0),
  486. PADCONF(8, 3, 0x8, 0x100, 0x200, -1, 0, 16, 16, 0),
  487. PADCONF(9, 3, 0x8, 0x100, 0x200, -1, 4, 18, 18, 0),
  488. PADCONF(10, 4, 0x8, 0x100, 0x200, -1, 8, 20, 20, 0),
  489. PADCONF(11, 4, 0x8, 0x100, 0x200, -1, 12, 22, 22, 0),
  490. PADCONF(12, 5, 0x8, 0x100, 0x200, -1, 16, 24, 24, 0),
  491. PADCONF(13, 6, 0x8, 0x100, 0x200, -1, 20, 26, 26, 0),
  492. PADCONF(14, 5, 0x8, 0x100, 0x200, -1, 24, 28, 28, 0),
  493. PADCONF(15, 5, 0x8, 0x100, 0x200, -1, 28, 30, 30, 0),
  494. PADCONF(16, 5, 0x10, 0x108, 0x208, -1, 0, 0, 0, 0),
  495. PADCONF(17, 5, 0x10, 0x108, 0x208, -1, 4, 2, 2, 0),
  496. /* The Configuration of IOC_TOP Pads */
  497. PADCONF(18, 5, 0x80, 0x180, 0x300, -1, 0, 0, 0, 0),
  498. PADCONF(19, 5, 0x80, 0x180, 0x300, -1, 4, 2, 2, 0),
  499. PADCONF(20, 5, 0x80, 0x180, 0x300, -1, 8, 4, 4, 0),
  500. PADCONF(21, 5, 0x80, 0x180, 0x300, -1, 12, 6, 6, 0),
  501. PADCONF(22, 5, 0x88, 0x188, 0x308, -1, 0, 0, 0, 0),
  502. PADCONF(23, 5, 0x88, 0x188, 0x308, -1, 4, 2, 2, 0),
  503. PADCONF(24, 5, 0x88, 0x188, 0x308, -1, 8, 4, 4, 0),
  504. PADCONF(25, 6, 0x88, 0x188, 0x308, -1, 12, 6, 6, 0),
  505. PADCONF(26, 5, 0x88, 0x188, 0x308, -1, 16, 8, 8, 0),
  506. PADCONF(27, 6, 0x88, 0x188, 0x308, -1, 20, 10, 10, 0),
  507. PADCONF(28, 5, 0x88, 0x188, 0x308, -1, 24, 12, 12, 0),
  508. PADCONF(29, 5, 0x88, 0x188, 0x308, -1, 28, 14, 14, 0),
  509. PADCONF(30, 5, 0x90, 0x188, 0x308, -1, 0, 16, 16, 0),
  510. PADCONF(31, 2, 0x98, 0x190, 0x310, -1, 0, 0, 0, 0),
  511. PADCONF(32, 1, 0x98, 0x190, 0x310, -1, 4, 2, 4, 0),
  512. PADCONF(33, 1, 0x98, 0x190, 0x310, -1, 8, 4, 6, 0),
  513. PADCONF(34, 1, 0x98, 0x190, 0x310, -1, 12, 6, 8, 0),
  514. PADCONF(35, 1, 0x98, 0x190, 0x310, -1, 16, 8, 10, 0),
  515. PADCONF(36, 1, 0x98, 0x190, 0x310, -1, 20, 10, 12, 0),
  516. PADCONF(37, 1, 0xa0, 0x198, 0x318, -1, 0, 0, 0, 0),
  517. PADCONF(38, 1, 0xa0, 0x198, 0x318, -1, 4, 2, 2, 0),
  518. PADCONF(39, 1, 0xa0, 0x198, 0x318, -1, 8, 4, 4, 0),
  519. PADCONF(40, 1, 0xa0, 0x198, 0x318, -1, 12, 6, 6, 0),
  520. PADCONF(41, 1, 0xa0, 0x198, 0x318, -1, 16, 8, 8, 0),
  521. PADCONF(42, 1, 0xa0, 0x198, 0x318, -1, 20, 10, 10, 0),
  522. PADCONF(43, 1, 0xa0, 0x198, 0x318, -1, 24, 12, 12, 0),
  523. PADCONF(44, 1, 0xa0, 0x198, 0x318, -1, 28, 14, 14, 0),
  524. PADCONF(45, 0, 0xa8, 0x198, 0x318, -1, 0, 16, 16, 0),
  525. PADCONF(46, 0, 0xa8, 0x198, 0x318, -1, 4, 18, 18, 0),
  526. PADCONF(47, 1, 0xa8, 0x198, 0x318, -1, 8, 20, 20, 0),
  527. PADCONF(48, 1, 0xa8, 0x198, 0x318, -1, 12, 22, 22, 0),
  528. PADCONF(49, 1, 0xa8, 0x198, 0x318, -1, 16, 24, 24, 0),
  529. PADCONF(50, 1, 0xa8, 0x198, 0x318, -1, 20, 26, 26, 0),
  530. PADCONF(51, 1, 0xa8, 0x198, 0x318, -1, 24, 28, 28, 0),
  531. PADCONF(52, 1, 0xa8, 0x198, 0x318, -1, 28, 30, 30, 0),
  532. PADCONF(53, 0, 0xb0, 0x1a0, 0x320, -1, 0, 0, 0, 0),
  533. PADCONF(54, 0, 0xb0, 0x1a0, 0x320, -1, 4, 2, 2, 0),
  534. PADCONF(55, 0, 0xb0, 0x1a0, 0x320, -1, 8, 4, 4, 0),
  535. PADCONF(56, 0, 0xb0, 0x1a0, 0x320, -1, 12, 6, 6, 0),
  536. PADCONF(57, 0, 0xb0, 0x1a0, 0x320, -1, 16, 8, 8, 0),
  537. PADCONF(58, 0, 0xb0, 0x1a0, 0x320, -1, 20, 10, 10, 0),
  538. PADCONF(59, 0, 0xb0, 0x1a0, 0x320, -1, 24, 12, 12, 0),
  539. PADCONF(60, 0, 0xb0, 0x1a0, 0x320, -1, 28, 14, 14, 0),
  540. PADCONF(61, 0, 0xb8, 0x1a0, 0x320, -1, 0, 16, 16, 0),
  541. PADCONF(62, 0, 0xb8, 0x1a0, 0x320, -1, 4, 18, 18, 0),
  542. PADCONF(63, 0, 0xb8, 0x1a0, 0x320, -1, 8, 20, 20, 0),
  543. PADCONF(64, 0, 0xb8, 0x1a0, 0x320, -1, 12, 22, 22, 0),
  544. PADCONF(65, 0, 0xb8, 0x1a0, 0x320, -1, 16, 24, 24, 0),
  545. PADCONF(66, 0, 0xb8, 0x1a0, 0x320, -1, 20, 26, 26, 0),
  546. PADCONF(67, 0, 0xb8, 0x1a0, 0x320, -1, 24, 28, 28, 0),
  547. PADCONF(68, 0, 0xb8, 0x1a0, 0x320, -1, 28, 30, 30, 0),
  548. PADCONF(69, 0, 0xc0, 0x1a8, 0x328, -1, 0, 0, 0, 0),
  549. PADCONF(70, 0, 0xc0, 0x1a8, 0x328, -1, 4, 2, 2, 0),
  550. PADCONF(71, 0, 0xc0, 0x1a8, 0x328, -1, 8, 4, 4, 0),
  551. PADCONF(72, 0, 0xc0, 0x1a8, 0x328, -1, 12, 6, 6, 0),
  552. PADCONF(73, 0, 0xc0, 0x1a8, 0x328, -1, 16, 8, 8, 0),
  553. PADCONF(74, 0, 0xc8, 0x1b0, 0x330, -1, 0, 0, 0, 0),
  554. PADCONF(75, 0, 0xc8, 0x1b0, 0x330, -1, 4, 2, 2, 0),
  555. PADCONF(76, 0, 0xc8, 0x1b0, 0x330, -1, 8, 4, 4, 0),
  556. PADCONF(77, 0, 0xc8, 0x1b0, 0x330, -1, 12, 6, 6, 0),
  557. PADCONF(78, 0, 0xc8, 0x1b0, 0x330, -1, 16, 8, 8, 0),
  558. PADCONF(79, 0, 0xc8, 0x1b0, 0x330, -1, 20, 10, 10, 0),
  559. PADCONF(80, 0, 0xc8, 0x1b0, 0x330, -1, 24, 12, 12, 0),
  560. PADCONF(81, 0, 0xc8, 0x1b0, 0x330, -1, 28, 14, 14, 0),
  561. PADCONF(82, 0, 0xd0, 0x1b0, 0x330, -1, 0, 16, 16, 0),
  562. PADCONF(83, 0, 0xd0, 0x1b0, 0x330, -1, 4, 18, 18, 0),
  563. PADCONF(84, 0, 0xd0, 0x1b0, 0x330, -1, 8, 20, 20, 0),
  564. PADCONF(85, 2, 0xd8, 0x1b8, 0x338, -1, 0, 0, 0, 0),
  565. PADCONF(86, 1, 0xd8, 0x1b8, 0x338, -1, 4, 4, 4, 0),
  566. PADCONF(87, 1, 0xd8, 0x1b8, 0x338, -1, 8, 6, 6, 0),
  567. PADCONF(88, 1, 0xd8, 0x1b8, 0x338, -1, 12, 8, 8, 0),
  568. PADCONF(89, 1, 0xd8, 0x1b8, 0x338, -1, 16, 10, 10, 0),
  569. PADCONF(90, 1, 0xd8, 0x1b8, 0x338, -1, 20, 12, 12, 0),
  570. PADCONF(91, 2, 0xe0, 0x1c0, 0x340, -1, 0, 0, 0, 0),
  571. PADCONF(92, 1, 0xe0, 0x1c0, 0x340, -1, 4, 4, 4, 0),
  572. PADCONF(93, 1, 0xe0, 0x1c0, 0x340, -1, 8, 6, 6, 0),
  573. PADCONF(94, 1, 0xe0, 0x1c0, 0x340, -1, 12, 8, 8, 0),
  574. PADCONF(95, 1, 0xe0, 0x1c0, 0x340, -1, 16, 10, 10, 0),
  575. PADCONF(96, 1, 0xe0, 0x1c0, 0x340, -1, 20, 12, 12, 0),
  576. PADCONF(97, 0, 0xe8, 0x1c8, 0x348, -1, 0, 0, 0, 0),
  577. PADCONF(98, 0, 0xe8, 0x1c8, 0x348, -1, 4, 2, 2, 0),
  578. PADCONF(99, 0, 0xe8, 0x1c8, 0x348, -1, 8, 4, 4, 0),
  579. PADCONF(100, 0, 0xe8, 0x1c8, 0x348, -1, 12, 6, 6, 0),
  580. PADCONF(101, 2, 0xe8, 0x1c8, 0x348, -1, 16, 8, 8, 0),
  581. PADCONF(102, 0, 0xe8, 0x1c8, 0x348, -1, 20, 12, 12, 0),
  582. PADCONF(103, 0, 0xe8, 0x1c8, 0x348, -1, 24, 14, 14, 0),
  583. PADCONF(104, 0, 0xe8, 0x1c8, 0x348, -1, 28, 16, 16, 0),
  584. PADCONF(105, 0, 0xf0, 0x1c8, 0x348, -1, 0, 18, 18, 0),
  585. PADCONF(106, 0, 0xf0, 0x1c8, 0x348, -1, 4, 20, 20, 0),
  586. PADCONF(107, 0, 0xf0, 0x1c8, 0x348, -1, 8, 22, 22, 0),
  587. PADCONF(108, 0, 0xf0, 0x1c8, 0x348, -1, 12, 24, 24, 0),
  588. PADCONF(109, 1, 0xf0, 0x1c8, 0x348, -1, 16, 26, 26, 0),
  589. PADCONF(110, 0, 0xf0, 0x1c8, 0x348, -1, 20, 28, 28, 0),
  590. PADCONF(111, 1, 0xf0, 0x1c8, 0x348, -1, 24, 30, 30, 0),
  591. PADCONF(112, 5, 0xf8, 0x200, 0x350, -1, 0, 0, 0, 0),
  592. PADCONF(113, 5, 0xf8, 0x200, 0x350, -1, 4, 2, 2, 0),
  593. PADCONF(114, 5, 0xf8, 0x200, 0x350, -1, 8, 4, 4, 0),
  594. PADCONF(115, 5, 0xf8, 0x200, 0x350, -1, 12, 6, 6, 0),
  595. PADCONF(116, 5, 0xf8, 0x200, 0x350, -1, 16, 8, 8, 0),
  596. PADCONF(117, 5, 0xf8, 0x200, 0x350, -1, 20, 10, 10, 0),
  597. PADCONF(118, 5, 0xf8, 0x200, 0x350, -1, 24, 12, 12, 0),
  598. PADCONF(119, 5, 0x100, 0x250, 0x358, -1, 0, 0, 0, 0),
  599. PADCONF(120, 5, 0x100, 0x250, 0x358, -1, 4, 2, 2, 0),
  600. PADCONF(121, 5, 0x100, 0x250, 0x358, -1, 8, 4, 4, 0),
  601. PADCONF(122, 5, 0x100, 0x250, 0x358, -1, 12, 6, 6, 0),
  602. PADCONF(123, 6, 0x100, 0x250, 0x358, -1, 16, 8, 8, 0),
  603. PADCONF(124, 6, 0x100, 0x250, 0x358, -1, 20, 10, 10, 0),
  604. PADCONF(125, 6, 0x100, 0x250, 0x358, -1, 24, 12, 12, 0),
  605. PADCONF(126, 6, 0x100, 0x250, 0x358, -1, 28, 14, 14, 0),
  606. PADCONF(127, 6, 0x108, 0x250, 0x358, -1, 16, 24, 24, 0),
  607. PADCONF(128, 6, 0x108, 0x250, 0x358, -1, 20, 26, 26, 0),
  608. PADCONF(129, 0, 0x110, 0x258, 0x360, -1, 0, 0, 0, 0),
  609. PADCONF(130, 0, 0x110, 0x258, 0x360, -1, 4, 2, 2, 0),
  610. PADCONF(131, 0, 0x110, 0x258, 0x360, -1, 8, 4, 4, 0),
  611. PADCONF(132, 0, 0x110, 0x258, 0x360, -1, 12, 6, 6, 0),
  612. PADCONF(133, 6, 0x118, 0x260, 0x368, -1, 0, 0, 0, 0),
  613. PADCONF(134, 6, 0x118, 0x260, 0x368, -1, 4, 2, 2, 0),
  614. PADCONF(135, 6, 0x118, 0x260, 0x368, -1, 16, 8, 8, 0),
  615. PADCONF(136, 6, 0x118, 0x260, 0x368, -1, 20, 10, 10, 0),
  616. PADCONF(137, 6, 0x118, 0x260, 0x368, -1, 24, 12, 12, 0),
  617. PADCONF(138, 6, 0x118, 0x260, 0x368, -1, 28, 14, 14, 0),
  618. PADCONF(139, 6, 0x120, 0x260, 0x368, -1, 0, 16, 16, 0),
  619. PADCONF(140, 6, 0x120, 0x260, 0x368, -1, 4, 18, 18, 0),
  620. PADCONF(141, 5, 0x128, 0x268, 0x378, -1, 0, 0, 0, 0),
  621. PADCONF(142, 5, 0x128, 0x268, 0x378, -1, 4, 2, 2, 0),
  622. PADCONF(143, 5, 0x128, 0x268, 0x378, -1, 8, 4, 4, 0),
  623. PADCONF(144, 5, 0x128, 0x268, 0x378, -1, 12, 6, 6, 0),
  624. PADCONF(145, 5, 0x128, 0x268, 0x378, -1, 16, 8, 8, 0),
  625. PADCONF(146, 5, 0x128, 0x268, 0x378, -1, 20, 10, 10, 0),
  626. PADCONF(147, 5, 0x128, 0x268, 0x378, -1, 24, 12, 12, 0),
  627. PADCONF(148, 5, 0x128, 0x268, 0x378, -1, 28, 14, 14, 0),
  628. PADCONF(149, 7, 0x130, 0x270, -1, 0x480, 0, 0, 0, 0),
  629. PADCONF(150, 7, 0x130, 0x270, -1, 0x480, 4, 2, 0, 1),
  630. PADCONF(151, 7, 0x130, 0x270, -1, 0x480, 8, 4, 0, 2),
  631. PADCONF(152, 7, 0x130, 0x270, -1, 0x480, 12, 6, 0, 3),
  632. PADCONF(153, 7, 0x130, 0x270, -1, 0x480, 16, 8, 0, 4),
  633. PADCONF(154, 7, 0x130, 0x270, -1, 0x480, 20, 10, 0, 5),
  634. PADCONF(155, 7, 0x130, 0x270, -1, 0x480, 24, 12, 0, 6),
  635. PADCONF(156, 7, 0x130, 0x270, -1, 0x480, 28, 14, 0, 7),
  636. PADCONF(157, 7, 0x138, 0x278, -1, 0x480, 0, 0, 0, 8),
  637. PADCONF(158, 7, 0x138, 0x278, -1, 0x480, 4, 2, 0, 9),
  638. };
  639. /* pin list of each pin group */
  640. static const unsigned int gnss_gpio_pins[] = { 119, 120, 121, 122, 123, 124,
  641. 125, 126, 127, 128, 22, 23, 24, 25, 26, 27, 28, 29, 30, };
  642. static const unsigned int lcd_vip_gpio_pins[] = { 74, 75, 76, 77, 78, 79, 80,
  643. 81, 82, 83, 84, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  644. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, };
  645. static const unsigned int sdio_i2s_gpio_pins[] = { 31, 32, 33, 34, 35, 36,
  646. 85, 86, 87, 88, 89, 90, 129, 130, 131, 132, 91, 92, 93, 94,
  647. 95, 96, 112, 113, 114, 115, 116, 117, 118, };
  648. static const unsigned int sp_rgmii_gpio_pins[] = { 97, 98, 99, 100, 101, 102,
  649. 103, 104, 105, 106, 107, 108, 109, 110, 111, 18, 19, 20, 21,
  650. 141, 142, 143, 144, 145, 146, 147, 148, };
  651. static const unsigned int lvds_gpio_pins[] = { 157, 158, 155, 156, 153, 154,
  652. 151, 152, 149, 150, };
  653. static const unsigned int uart_nand_gpio_pins[] = { 44, 43, 42, 41, 40, 39,
  654. 38, 37, 46, 47, 48, 49, 50, 52, 51, 45, 133, 134, 135, 136,
  655. 137, 138, 139, 140, };
  656. static const unsigned int rtc_gpio_pins[] = { 0, 1, 2, 3, 4, 10, 11, 12, 13,
  657. 14, 15, 16, 17, };
  658. static const unsigned int audio_ac97_pins[] = { 113, 118, 115, 114, };
  659. static const unsigned int audio_func_dbg_pins[] = { 141, 144, 44, 43, 42, 41,
  660. 40, 39, 38, 37, 74, 75, 76, 77, 78, 79, 81, 113, 114, 118,
  661. 115, 49, 50, 142, 143, 80, };
  662. static const unsigned int audio_i2s_pins[] = { 118, 115, 116, 117, 112, 113,
  663. 114, };
  664. static const unsigned int audio_i2s_2ch_pins[] = { 118, 115, 112, 113, 114, };
  665. static const unsigned int audio_i2s_extclk_pins[] = { 112, };
  666. static const unsigned int audio_uart0_pins[] = { 143, 142, 141, 144, };
  667. static const unsigned int audio_uart1_pins[] = { 147, 146, 145, 148, };
  668. static const unsigned int audio_uart2_pins0[] = { 20, 21, 19, 18, };
  669. static const unsigned int audio_uart2_pins1[] = { 109, 110, 101, 111, };
  670. static const unsigned int c_can_trnsvr_pins[] = { 1, };
  671. static const unsigned int c0_can_pins0[] = { 11, 10, };
  672. static const unsigned int c0_can_pins1[] = { 2, 3, };
  673. static const unsigned int c1_can_pins0[] = { 138, 137, };
  674. static const unsigned int c1_can_pins1[] = { 147, 146, };
  675. static const unsigned int c1_can_pins2[] = { 2, 3, };
  676. static const unsigned int ca_audio_lpc_pins[] = { 62, 63, 64, 65, 66, 67, 68,
  677. 69, 70, 71, };
  678. static const unsigned int ca_bt_lpc_pins[] = { 85, 86, 87, 88, 89, 90, };
  679. static const unsigned int ca_coex_pins[] = { 129, 130, 131, 132, };
  680. static const unsigned int ca_curator_lpc_pins[] = { 57, 58, 59, 60, };
  681. static const unsigned int ca_pcm_debug_pins[] = { 91, 93, 94, 92, };
  682. static const unsigned int ca_pio_pins[] = { 121, 122, 125, 126, 38, 37, 47,
  683. 49, 50, 54, 55, 56, };
  684. static const unsigned int ca_sdio_debug_pins[] = { 40, 39, 44, 43, 42, 41, };
  685. static const unsigned int ca_spi_pins[] = { 82, 79, 80, 81, };
  686. static const unsigned int ca_trb_pins[] = { 91, 93, 94, 95, 96, 78, 74, 75,
  687. 76, 77, };
  688. static const unsigned int ca_uart_debug_pins[] = { 136, 135, 134, 133, };
  689. static const unsigned int clkc_pins0[] = { 30, 47, };
  690. static const unsigned int clkc_pins1[] = { 78, 54, };
  691. static const unsigned int gn_gnss_i2c_pins[] = { 128, 127, };
  692. static const unsigned int gn_gnss_uart_nopause_pins[] = { 134, 133, };
  693. static const unsigned int gn_gnss_uart_pins[] = { 134, 133, 136, 135, };
  694. static const unsigned int gn_trg_spi_pins0[] = { 22, 25, 23, 24, };
  695. static const unsigned int gn_trg_spi_pins1[] = { 82, 79, 80, 81, };
  696. static const unsigned int cvbs_dbg_pins[] = { 54, 53, 82, 74, 75, 76, 77, 78,
  697. 79, 80, 81, 83, 84, 73, 55, 56, };
  698. static const unsigned int cvbs_dbg_test_pins0[] = { 57, };
  699. static const unsigned int cvbs_dbg_test_pins1[] = { 58, };
  700. static const unsigned int cvbs_dbg_test_pins2[] = { 59, };
  701. static const unsigned int cvbs_dbg_test_pins3[] = { 60, };
  702. static const unsigned int cvbs_dbg_test_pins4[] = { 61, };
  703. static const unsigned int cvbs_dbg_test_pins5[] = { 62, };
  704. static const unsigned int cvbs_dbg_test_pins6[] = { 63, };
  705. static const unsigned int cvbs_dbg_test_pins7[] = { 64, };
  706. static const unsigned int cvbs_dbg_test_pins8[] = { 65, };
  707. static const unsigned int cvbs_dbg_test_pins9[] = { 66, };
  708. static const unsigned int cvbs_dbg_test_pins10[] = { 67, };
  709. static const unsigned int cvbs_dbg_test_pins11[] = { 68, };
  710. static const unsigned int cvbs_dbg_test_pins12[] = { 69, };
  711. static const unsigned int cvbs_dbg_test_pins13[] = { 70, };
  712. static const unsigned int cvbs_dbg_test_pins14[] = { 71, };
  713. static const unsigned int cvbs_dbg_test_pins15[] = { 72, };
  714. static const unsigned int gn_gnss_power_pins[] = { 123, 124, 121, 122, 125,
  715. 120, };
  716. static const unsigned int gn_gnss_sw_status_pins[] = { 57, 58, 59, 60, 61,
  717. 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 53, 55, 56, 54, };
  718. static const unsigned int gn_gnss_eclk_pins[] = { 113, };
  719. static const unsigned int gn_gnss_irq1_pins0[] = { 112, };
  720. static const unsigned int gn_gnss_irq2_pins0[] = { 118, };
  721. static const unsigned int gn_gnss_tm_pins[] = { 115, };
  722. static const unsigned int gn_gnss_tsync_pins[] = { 114, };
  723. static const unsigned int gn_io_gnsssys_sw_cfg_pins[] = { 44, 43, 42, 41, 40,
  724. 39, 38, 37, 49, 50, 91, 92, 93, 94, 95, 96, };
  725. static const unsigned int gn_trg_pins0[] = { 29, 28, 26, 27, };
  726. static const unsigned int gn_trg_pins1[] = { 77, 76, 74, 75, };
  727. static const unsigned int gn_trg_shutdown_pins0[] = { 30, };
  728. static const unsigned int gn_trg_shutdown_pins1[] = { 83, };
  729. static const unsigned int gn_trg_shutdown_pins2[] = { 117, };
  730. static const unsigned int gn_trg_shutdown_pins3[] = { 123, };
  731. static const unsigned int i2c0_pins[] = { 128, 127, };
  732. static const unsigned int i2c1_pins[] = { 126, 125, };
  733. static const unsigned int jtag_pins0[] = { 125, 4, 2, 0, 1, 3, };
  734. static const unsigned int ks_kas_spi_pins0[] = { 141, 144, 143, 142, };
  735. static const unsigned int ld_ldd_pins[] = { 57, 58, 59, 60, 61, 62, 63, 64,
  736. 65, 66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80,
  737. 81, 56, 53, };
  738. static const unsigned int ld_ldd_16bit_pins[] = { 57, 58, 59, 60, 61, 62, 63,
  739. 64, 65, 66, 67, 68, 69, 70, 71, 72, 56, 53, };
  740. static const unsigned int ld_ldd_fck_pins[] = { 55, };
  741. static const unsigned int ld_ldd_lck_pins[] = { 54, };
  742. static const unsigned int lr_lcdrom_pins[] = { 73, 54, 57, 58, 59, 60, 61,
  743. 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 56, 53, 55, };
  744. static const unsigned int lvds_analog_pins[] = { 149, 150, 151, 152, 153, 154,
  745. 155, 156, 157, 158, };
  746. static const unsigned int nd_df_pins[] = { 44, 43, 42, 41, 40, 39, 38, 37,
  747. 47, 46, 52, 51, 45, 49, 50, 48, 124, };
  748. static const unsigned int nd_df_nowp_pins[] = { 44, 43, 42, 41, 40, 39, 38,
  749. 37, 47, 46, 52, 51, 45, 49, 50, 48, };
  750. static const unsigned int ps_pins[] = { 120, 119, };
  751. static const unsigned int pwc_core_on_pins[] = { 8, };
  752. static const unsigned int pwc_ext_on_pins[] = { 6, };
  753. static const unsigned int pwc_gpio3_clk_pins[] = { 3, };
  754. static const unsigned int pwc_io_on_pins[] = { 9, };
  755. static const unsigned int pwc_lowbatt_b_pins0[] = { 4, };
  756. static const unsigned int pwc_mem_on_pins[] = { 7, };
  757. static const unsigned int pwc_on_key_b_pins0[] = { 5, };
  758. static const unsigned int pwc_wakeup_src0_pins[] = { 0, };
  759. static const unsigned int pwc_wakeup_src1_pins[] = { 1, };
  760. static const unsigned int pwc_wakeup_src2_pins[] = { 2, };
  761. static const unsigned int pwc_wakeup_src3_pins[] = { 3, };
  762. static const unsigned int pw_cko0_pins0[] = { 123, };
  763. static const unsigned int pw_cko0_pins1[] = { 101, };
  764. static const unsigned int pw_cko0_pins2[] = { 82, };
  765. static const unsigned int pw_cko1_pins0[] = { 124, };
  766. static const unsigned int pw_cko1_pins1[] = { 110, };
  767. static const unsigned int pw_i2s01_clk_pins0[] = { 125, };
  768. static const unsigned int pw_i2s01_clk_pins1[] = { 117, };
  769. static const unsigned int pw_pwm0_pins[] = { 119, };
  770. static const unsigned int pw_pwm1_pins[] = { 120, };
  771. static const unsigned int pw_pwm2_pins0[] = { 121, };
  772. static const unsigned int pw_pwm2_pins1[] = { 98, };
  773. static const unsigned int pw_pwm3_pins0[] = { 122, };
  774. static const unsigned int pw_pwm3_pins1[] = { 73, };
  775. static const unsigned int pw_pwm_cpu_vol_pins0[] = { 121, };
  776. static const unsigned int pw_pwm_cpu_vol_pins1[] = { 98, };
  777. static const unsigned int pw_backlight_pins0[] = { 122, };
  778. static const unsigned int pw_backlight_pins1[] = { 73, };
  779. static const unsigned int rg_eth_mac_pins[] = { 108, 103, 104, 105, 106, 107,
  780. 102, 97, 98, 99, 100, 101, };
  781. static const unsigned int rg_gmac_phy_intr_n_pins[] = { 111, };
  782. static const unsigned int rg_rgmii_mac_pins[] = { 109, 110, };
  783. static const unsigned int rg_rgmii_phy_ref_clk_pins0[] = { 111, };
  784. static const unsigned int rg_rgmii_phy_ref_clk_pins1[] = { 53, };
  785. static const unsigned int sd0_pins[] = { 46, 47, 44, 43, 42, 41, 40, 39, 38,
  786. 37, };
  787. static const unsigned int sd0_4bit_pins[] = { 46, 47, 44, 43, 42, 41, };
  788. static const unsigned int sd1_pins[] = { 48, 49, 44, 43, 42, 41, 40, 39, 38,
  789. 37, };
  790. static const unsigned int sd1_4bit_pins0[] = { 48, 49, 44, 43, 42, 41, };
  791. static const unsigned int sd1_4bit_pins1[] = { 48, 49, 40, 39, 38, 37, };
  792. static const unsigned int sd2_pins0[] = { 124, 31, 32, 33, 34, 35, 36, 123, };
  793. static const unsigned int sd2_no_cdb_pins0[] = { 31, 32, 33, 34, 35, 36, 123, };
  794. static const unsigned int sd3_pins[] = { 85, 86, 87, 88, 89, 90, };
  795. static const unsigned int sd5_pins[] = { 91, 92, 93, 94, 95, 96, };
  796. static const unsigned int sd6_pins0[] = { 79, 78, 74, 75, 76, 77, };
  797. static const unsigned int sd6_pins1[] = { 101, 99, 100, 110, 109, 111, };
  798. static const unsigned int sp0_ext_ldo_on_pins[] = { 4, };
  799. static const unsigned int sp0_qspi_pins[] = { 12, 13, 14, 15, 16, 17, };
  800. static const unsigned int sp1_spi_pins[] = { 19, 20, 21, 18, };
  801. static const unsigned int tpiu_trace_pins[] = { 53, 56, 57, 58, 59, 60, 61,
  802. 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, };
  803. static const unsigned int uart0_pins[] = { 121, 120, 134, 133, };
  804. static const unsigned int uart0_nopause_pins[] = { 134, 133, };
  805. static const unsigned int uart1_pins[] = { 136, 135, };
  806. static const unsigned int uart2_pins[] = { 11, 10, };
  807. static const unsigned int uart3_pins0[] = { 125, 126, 138, 137, };
  808. static const unsigned int uart3_pins1[] = { 111, 109, 84, 83, };
  809. static const unsigned int uart3_pins2[] = { 140, 139, 138, 137, };
  810. static const unsigned int uart3_pins3[] = { 139, 140, 84, 83, };
  811. static const unsigned int uart3_nopause_pins0[] = { 138, 137, };
  812. static const unsigned int uart3_nopause_pins1[] = { 84, 83, };
  813. static const unsigned int uart4_pins0[] = { 122, 123, 140, 139, };
  814. static const unsigned int uart4_pins1[] = { 100, 99, 140, 139, };
  815. static const unsigned int uart4_pins2[] = { 117, 116, 140, 139, };
  816. static const unsigned int uart4_nopause_pins[] = { 140, 139, };
  817. static const unsigned int usb0_drvvbus_pins[] = { 51, };
  818. static const unsigned int usb1_drvvbus_pins[] = { 134, };
  819. static const unsigned int visbus_dout_pins[] = { 57, 58, 59, 60, 61, 62, 63,
  820. 64, 65, 66, 67, 68, 69, 70, 71, 72, 53, 54, 55, 56, 85, 86,
  821. 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, };
  822. static const unsigned int vi_vip1_pins[] = { 74, 75, 76, 77, 78, 79, 80, 81,
  823. 82, 83, 84, 103, 104, 105, 106, 107, 102, 97, 98, };
  824. static const unsigned int vi_vip1_ext_pins[] = { 74, 75, 76, 77, 78, 79, 80,
  825. 81, 82, 83, 84, 108, 103, 104, 105, 106, 107, 102, 97, 98,
  826. 99, 100, };
  827. static const unsigned int vi_vip1_low8bit_pins[] = { 74, 75, 76, 77, 78, 79,
  828. 80, 81, };
  829. static const unsigned int vi_vip1_high8bit_pins[] = { 82, 83, 84, 108, 103,
  830. 104, 105, 106, };
  831. /* definition of pin group table */
  832. struct atlas7_pin_group altas7_pin_groups[] = {
  833. GROUP("gnss_gpio_grp", gnss_gpio_pins),
  834. GROUP("lcd_vip_gpio_grp", lcd_vip_gpio_pins),
  835. GROUP("sdio_i2s_gpio_grp", sdio_i2s_gpio_pins),
  836. GROUP("sp_rgmii_gpio_grp", sp_rgmii_gpio_pins),
  837. GROUP("lvds_gpio_grp", lvds_gpio_pins),
  838. GROUP("uart_nand_gpio_grp", uart_nand_gpio_pins),
  839. GROUP("rtc_gpio_grp", rtc_gpio_pins),
  840. GROUP("audio_ac97_grp", audio_ac97_pins),
  841. GROUP("audio_func_dbg_grp", audio_func_dbg_pins),
  842. GROUP("audio_i2s_grp", audio_i2s_pins),
  843. GROUP("audio_i2s_2ch_grp", audio_i2s_2ch_pins),
  844. GROUP("audio_i2s_extclk_grp", audio_i2s_extclk_pins),
  845. GROUP("audio_uart0_grp", audio_uart0_pins),
  846. GROUP("audio_uart1_grp", audio_uart1_pins),
  847. GROUP("audio_uart2_grp0", audio_uart2_pins0),
  848. GROUP("audio_uart2_grp1", audio_uart2_pins1),
  849. GROUP("c_can_trnsvr_grp", c_can_trnsvr_pins),
  850. GROUP("c0_can_grp0", c0_can_pins0),
  851. GROUP("c0_can_grp1", c0_can_pins1),
  852. GROUP("c1_can_grp0", c1_can_pins0),
  853. GROUP("c1_can_grp1", c1_can_pins1),
  854. GROUP("c1_can_grp2", c1_can_pins2),
  855. GROUP("ca_audio_lpc_grp", ca_audio_lpc_pins),
  856. GROUP("ca_bt_lpc_grp", ca_bt_lpc_pins),
  857. GROUP("ca_coex_grp", ca_coex_pins),
  858. GROUP("ca_curator_lpc_grp", ca_curator_lpc_pins),
  859. GROUP("ca_pcm_debug_grp", ca_pcm_debug_pins),
  860. GROUP("ca_pio_grp", ca_pio_pins),
  861. GROUP("ca_sdio_debug_grp", ca_sdio_debug_pins),
  862. GROUP("ca_spi_grp", ca_spi_pins),
  863. GROUP("ca_trb_grp", ca_trb_pins),
  864. GROUP("ca_uart_debug_grp", ca_uart_debug_pins),
  865. GROUP("clkc_grp0", clkc_pins0),
  866. GROUP("clkc_grp1", clkc_pins1),
  867. GROUP("gn_gnss_i2c_grp", gn_gnss_i2c_pins),
  868. GROUP("gn_gnss_uart_nopause_grp", gn_gnss_uart_nopause_pins),
  869. GROUP("gn_gnss_uart_grp", gn_gnss_uart_pins),
  870. GROUP("gn_trg_spi_grp0", gn_trg_spi_pins0),
  871. GROUP("gn_trg_spi_grp1", gn_trg_spi_pins1),
  872. GROUP("cvbs_dbg_grp", cvbs_dbg_pins),
  873. GROUP("cvbs_dbg_test_grp0", cvbs_dbg_test_pins0),
  874. GROUP("cvbs_dbg_test_grp1", cvbs_dbg_test_pins1),
  875. GROUP("cvbs_dbg_test_grp2", cvbs_dbg_test_pins2),
  876. GROUP("cvbs_dbg_test_grp3", cvbs_dbg_test_pins3),
  877. GROUP("cvbs_dbg_test_grp4", cvbs_dbg_test_pins4),
  878. GROUP("cvbs_dbg_test_grp5", cvbs_dbg_test_pins5),
  879. GROUP("cvbs_dbg_test_grp6", cvbs_dbg_test_pins6),
  880. GROUP("cvbs_dbg_test_grp7", cvbs_dbg_test_pins7),
  881. GROUP("cvbs_dbg_test_grp8", cvbs_dbg_test_pins8),
  882. GROUP("cvbs_dbg_test_grp9", cvbs_dbg_test_pins9),
  883. GROUP("cvbs_dbg_test_grp10", cvbs_dbg_test_pins10),
  884. GROUP("cvbs_dbg_test_grp11", cvbs_dbg_test_pins11),
  885. GROUP("cvbs_dbg_test_grp12", cvbs_dbg_test_pins12),
  886. GROUP("cvbs_dbg_test_grp13", cvbs_dbg_test_pins13),
  887. GROUP("cvbs_dbg_test_grp14", cvbs_dbg_test_pins14),
  888. GROUP("cvbs_dbg_test_grp15", cvbs_dbg_test_pins15),
  889. GROUP("gn_gnss_power_grp", gn_gnss_power_pins),
  890. GROUP("gn_gnss_sw_status_grp", gn_gnss_sw_status_pins),
  891. GROUP("gn_gnss_eclk_grp", gn_gnss_eclk_pins),
  892. GROUP("gn_gnss_irq1_grp0", gn_gnss_irq1_pins0),
  893. GROUP("gn_gnss_irq2_grp0", gn_gnss_irq2_pins0),
  894. GROUP("gn_gnss_tm_grp", gn_gnss_tm_pins),
  895. GROUP("gn_gnss_tsync_grp", gn_gnss_tsync_pins),
  896. GROUP("gn_io_gnsssys_sw_cfg_grp", gn_io_gnsssys_sw_cfg_pins),
  897. GROUP("gn_trg_grp0", gn_trg_pins0),
  898. GROUP("gn_trg_grp1", gn_trg_pins1),
  899. GROUP("gn_trg_shutdown_grp0", gn_trg_shutdown_pins0),
  900. GROUP("gn_trg_shutdown_grp1", gn_trg_shutdown_pins1),
  901. GROUP("gn_trg_shutdown_grp2", gn_trg_shutdown_pins2),
  902. GROUP("gn_trg_shutdown_grp3", gn_trg_shutdown_pins3),
  903. GROUP("i2c0_grp", i2c0_pins),
  904. GROUP("i2c1_grp", i2c1_pins),
  905. GROUP("jtag_grp0", jtag_pins0),
  906. GROUP("ks_kas_spi_grp0", ks_kas_spi_pins0),
  907. GROUP("ld_ldd_grp", ld_ldd_pins),
  908. GROUP("ld_ldd_16bit_grp", ld_ldd_16bit_pins),
  909. GROUP("ld_ldd_fck_grp", ld_ldd_fck_pins),
  910. GROUP("ld_ldd_lck_grp", ld_ldd_lck_pins),
  911. GROUP("lr_lcdrom_grp", lr_lcdrom_pins),
  912. GROUP("lvds_analog_grp", lvds_analog_pins),
  913. GROUP("nd_df_grp", nd_df_pins),
  914. GROUP("nd_df_nowp_grp", nd_df_nowp_pins),
  915. GROUP("ps_grp", ps_pins),
  916. GROUP("pwc_core_on_grp", pwc_core_on_pins),
  917. GROUP("pwc_ext_on_grp", pwc_ext_on_pins),
  918. GROUP("pwc_gpio3_clk_grp", pwc_gpio3_clk_pins),
  919. GROUP("pwc_io_on_grp", pwc_io_on_pins),
  920. GROUP("pwc_lowbatt_b_grp0", pwc_lowbatt_b_pins0),
  921. GROUP("pwc_mem_on_grp", pwc_mem_on_pins),
  922. GROUP("pwc_on_key_b_grp0", pwc_on_key_b_pins0),
  923. GROUP("pwc_wakeup_src0_grp", pwc_wakeup_src0_pins),
  924. GROUP("pwc_wakeup_src1_grp", pwc_wakeup_src1_pins),
  925. GROUP("pwc_wakeup_src2_grp", pwc_wakeup_src2_pins),
  926. GROUP("pwc_wakeup_src3_grp", pwc_wakeup_src3_pins),
  927. GROUP("pw_cko0_grp0", pw_cko0_pins0),
  928. GROUP("pw_cko0_grp1", pw_cko0_pins1),
  929. GROUP("pw_cko0_grp2", pw_cko0_pins2),
  930. GROUP("pw_cko1_grp0", pw_cko1_pins0),
  931. GROUP("pw_cko1_grp1", pw_cko1_pins1),
  932. GROUP("pw_i2s01_clk_grp0", pw_i2s01_clk_pins0),
  933. GROUP("pw_i2s01_clk_grp1", pw_i2s01_clk_pins1),
  934. GROUP("pw_pwm0_grp", pw_pwm0_pins),
  935. GROUP("pw_pwm1_grp", pw_pwm1_pins),
  936. GROUP("pw_pwm2_grp0", pw_pwm2_pins0),
  937. GROUP("pw_pwm2_grp1", pw_pwm2_pins1),
  938. GROUP("pw_pwm3_grp0", pw_pwm3_pins0),
  939. GROUP("pw_pwm3_grp1", pw_pwm3_pins1),
  940. GROUP("pw_pwm_cpu_vol_grp0", pw_pwm_cpu_vol_pins0),
  941. GROUP("pw_pwm_cpu_vol_grp1", pw_pwm_cpu_vol_pins1),
  942. GROUP("pw_backlight_grp0", pw_backlight_pins0),
  943. GROUP("pw_backlight_grp1", pw_backlight_pins1),
  944. GROUP("rg_eth_mac_grp", rg_eth_mac_pins),
  945. GROUP("rg_gmac_phy_intr_n_grp", rg_gmac_phy_intr_n_pins),
  946. GROUP("rg_rgmii_mac_grp", rg_rgmii_mac_pins),
  947. GROUP("rg_rgmii_phy_ref_clk_grp0", rg_rgmii_phy_ref_clk_pins0),
  948. GROUP("rg_rgmii_phy_ref_clk_grp1", rg_rgmii_phy_ref_clk_pins1),
  949. GROUP("sd0_grp", sd0_pins),
  950. GROUP("sd0_4bit_grp", sd0_4bit_pins),
  951. GROUP("sd1_grp", sd1_pins),
  952. GROUP("sd1_4bit_grp0", sd1_4bit_pins0),
  953. GROUP("sd1_4bit_grp1", sd1_4bit_pins1),
  954. GROUP("sd2_grp0", sd2_pins0),
  955. GROUP("sd2_no_cdb_grp0", sd2_no_cdb_pins0),
  956. GROUP("sd3_grp", sd3_pins),
  957. GROUP("sd5_grp", sd5_pins),
  958. GROUP("sd6_grp0", sd6_pins0),
  959. GROUP("sd6_grp1", sd6_pins1),
  960. GROUP("sp0_ext_ldo_on_grp", sp0_ext_ldo_on_pins),
  961. GROUP("sp0_qspi_grp", sp0_qspi_pins),
  962. GROUP("sp1_spi_grp", sp1_spi_pins),
  963. GROUP("tpiu_trace_grp", tpiu_trace_pins),
  964. GROUP("uart0_grp", uart0_pins),
  965. GROUP("uart0_nopause_grp", uart0_nopause_pins),
  966. GROUP("uart1_grp", uart1_pins),
  967. GROUP("uart2_grp", uart2_pins),
  968. GROUP("uart3_grp0", uart3_pins0),
  969. GROUP("uart3_grp1", uart3_pins1),
  970. GROUP("uart3_grp2", uart3_pins2),
  971. GROUP("uart3_grp3", uart3_pins3),
  972. GROUP("uart3_nopause_grp0", uart3_nopause_pins0),
  973. GROUP("uart3_nopause_grp1", uart3_nopause_pins1),
  974. GROUP("uart4_grp0", uart4_pins0),
  975. GROUP("uart4_grp1", uart4_pins1),
  976. GROUP("uart4_grp2", uart4_pins2),
  977. GROUP("uart4_nopause_grp", uart4_nopause_pins),
  978. GROUP("usb0_drvvbus_grp", usb0_drvvbus_pins),
  979. GROUP("usb1_drvvbus_grp", usb1_drvvbus_pins),
  980. GROUP("visbus_dout_grp", visbus_dout_pins),
  981. GROUP("vi_vip1_grp", vi_vip1_pins),
  982. GROUP("vi_vip1_ext_grp", vi_vip1_ext_pins),
  983. GROUP("vi_vip1_low8bit_grp", vi_vip1_low8bit_pins),
  984. GROUP("vi_vip1_high8bit_grp", vi_vip1_high8bit_pins),
  985. };
  986. /* How many groups that a function can use */
  987. static const char * const gnss_gpio_grp[] = { "gnss_gpio_grp", };
  988. static const char * const lcd_vip_gpio_grp[] = { "lcd_vip_gpio_grp", };
  989. static const char * const sdio_i2s_gpio_grp[] = { "sdio_i2s_gpio_grp", };
  990. static const char * const sp_rgmii_gpio_grp[] = { "sp_rgmii_gpio_grp", };
  991. static const char * const lvds_gpio_grp[] = { "lvds_gpio_grp", };
  992. static const char * const uart_nand_gpio_grp[] = { "uart_nand_gpio_grp", };
  993. static const char * const rtc_gpio_grp[] = { "rtc_gpio_grp", };
  994. static const char * const audio_ac97_grp[] = { "audio_ac97_grp", };
  995. static const char * const audio_func_dbg_grp[] = { "audio_func_dbg_grp", };
  996. static const char * const audio_i2s_grp[] = { "audio_i2s_grp", };
  997. static const char * const audio_i2s_2ch_grp[] = { "audio_i2s_2ch_grp", };
  998. static const char * const audio_i2s_extclk_grp[] = { "audio_i2s_extclk_grp", };
  999. static const char * const audio_uart0_grp[] = { "audio_uart0_grp", };
  1000. static const char * const audio_uart1_grp[] = { "audio_uart1_grp", };
  1001. static const char * const audio_uart2_grp0[] = { "audio_uart2_grp0", };
  1002. static const char * const audio_uart2_grp1[] = { "audio_uart2_grp1", };
  1003. static const char * const c_can_trnsvr_grp[] = { "c_can_trnsvr_grp", };
  1004. static const char * const c0_can_grp0[] = { "c0_can_grp0", };
  1005. static const char * const c0_can_grp1[] = { "c0_can_grp1", };
  1006. static const char * const c1_can_grp0[] = { "c1_can_grp0", };
  1007. static const char * const c1_can_grp1[] = { "c1_can_grp1", };
  1008. static const char * const c1_can_grp2[] = { "c1_can_grp2", };
  1009. static const char * const ca_audio_lpc_grp[] = { "ca_audio_lpc_grp", };
  1010. static const char * const ca_bt_lpc_grp[] = { "ca_bt_lpc_grp", };
  1011. static const char * const ca_coex_grp[] = { "ca_coex_grp", };
  1012. static const char * const ca_curator_lpc_grp[] = { "ca_curator_lpc_grp", };
  1013. static const char * const ca_pcm_debug_grp[] = { "ca_pcm_debug_grp", };
  1014. static const char * const ca_pio_grp[] = { "ca_pio_grp", };
  1015. static const char * const ca_sdio_debug_grp[] = { "ca_sdio_debug_grp", };
  1016. static const char * const ca_spi_grp[] = { "ca_spi_grp", };
  1017. static const char * const ca_trb_grp[] = { "ca_trb_grp", };
  1018. static const char * const ca_uart_debug_grp[] = { "ca_uart_debug_grp", };
  1019. static const char * const clkc_grp0[] = { "clkc_grp0", };
  1020. static const char * const clkc_grp1[] = { "clkc_grp1", };
  1021. static const char * const gn_gnss_i2c_grp[] = { "gn_gnss_i2c_grp", };
  1022. static const char * const gn_gnss_uart_nopause_grp[] = {
  1023. "gn_gnss_uart_nopause_grp", };
  1024. static const char * const gn_gnss_uart_grp[] = { "gn_gnss_uart_grp", };
  1025. static const char * const gn_trg_spi_grp0[] = { "gn_trg_spi_grp0", };
  1026. static const char * const gn_trg_spi_grp1[] = { "gn_trg_spi_grp1", };
  1027. static const char * const cvbs_dbg_grp[] = { "cvbs_dbg_grp", };
  1028. static const char * const cvbs_dbg_test_grp0[] = { "cvbs_dbg_test_grp0", };
  1029. static const char * const cvbs_dbg_test_grp1[] = { "cvbs_dbg_test_grp1", };
  1030. static const char * const cvbs_dbg_test_grp2[] = { "cvbs_dbg_test_grp2", };
  1031. static const char * const cvbs_dbg_test_grp3[] = { "cvbs_dbg_test_grp3", };
  1032. static const char * const cvbs_dbg_test_grp4[] = { "cvbs_dbg_test_grp4", };
  1033. static const char * const cvbs_dbg_test_grp5[] = { "cvbs_dbg_test_grp5", };
  1034. static const char * const cvbs_dbg_test_grp6[] = { "cvbs_dbg_test_grp6", };
  1035. static const char * const cvbs_dbg_test_grp7[] = { "cvbs_dbg_test_grp7", };
  1036. static const char * const cvbs_dbg_test_grp8[] = { "cvbs_dbg_test_grp8", };
  1037. static const char * const cvbs_dbg_test_grp9[] = { "cvbs_dbg_test_grp9", };
  1038. static const char * const cvbs_dbg_test_grp10[] = { "cvbs_dbg_test_grp10", };
  1039. static const char * const cvbs_dbg_test_grp11[] = { "cvbs_dbg_test_grp11", };
  1040. static const char * const cvbs_dbg_test_grp12[] = { "cvbs_dbg_test_grp12", };
  1041. static const char * const cvbs_dbg_test_grp13[] = { "cvbs_dbg_test_grp13", };
  1042. static const char * const cvbs_dbg_test_grp14[] = { "cvbs_dbg_test_grp14", };
  1043. static const char * const cvbs_dbg_test_grp15[] = { "cvbs_dbg_test_grp15", };
  1044. static const char * const gn_gnss_power_grp[] = { "gn_gnss_power_grp", };
  1045. static const char * const gn_gnss_sw_status_grp[] = {
  1046. "gn_gnss_sw_status_grp", };
  1047. static const char * const gn_gnss_eclk_grp[] = { "gn_gnss_eclk_grp", };
  1048. static const char * const gn_gnss_irq1_grp0[] = { "gn_gnss_irq1_grp0", };
  1049. static const char * const gn_gnss_irq2_grp0[] = { "gn_gnss_irq2_grp0", };
  1050. static const char * const gn_gnss_tm_grp[] = { "gn_gnss_tm_grp", };
  1051. static const char * const gn_gnss_tsync_grp[] = { "gn_gnss_tsync_grp", };
  1052. static const char * const gn_io_gnsssys_sw_cfg_grp[] = {
  1053. "gn_io_gnsssys_sw_cfg_grp", };
  1054. static const char * const gn_trg_grp0[] = { "gn_trg_grp0", };
  1055. static const char * const gn_trg_grp1[] = { "gn_trg_grp1", };
  1056. static const char * const gn_trg_shutdown_grp0[] = { "gn_trg_shutdown_grp0", };
  1057. static const char * const gn_trg_shutdown_grp1[] = { "gn_trg_shutdown_grp1", };
  1058. static const char * const gn_trg_shutdown_grp2[] = { "gn_trg_shutdown_grp2", };
  1059. static const char * const gn_trg_shutdown_grp3[] = { "gn_trg_shutdown_grp3", };
  1060. static const char * const i2c0_grp[] = { "i2c0_grp", };
  1061. static const char * const i2c1_grp[] = { "i2c1_grp", };
  1062. static const char * const jtag_grp0[] = { "jtag_grp0", };
  1063. static const char * const ks_kas_spi_grp0[] = { "ks_kas_spi_grp0", };
  1064. static const char * const ld_ldd_grp[] = { "ld_ldd_grp", };
  1065. static const char * const ld_ldd_16bit_grp[] = { "ld_ldd_16bit_grp", };
  1066. static const char * const ld_ldd_fck_grp[] = { "ld_ldd_fck_grp", };
  1067. static const char * const ld_ldd_lck_grp[] = { "ld_ldd_lck_grp", };
  1068. static const char * const lr_lcdrom_grp[] = { "lr_lcdrom_grp", };
  1069. static const char * const lvds_analog_grp[] = { "lvds_analog_grp", };
  1070. static const char * const nd_df_grp[] = { "nd_df_grp", };
  1071. static const char * const nd_df_nowp_grp[] = { "nd_df_nowp_grp", };
  1072. static const char * const ps_grp[] = { "ps_grp", };
  1073. static const char * const pwc_core_on_grp[] = { "pwc_core_on_grp", };
  1074. static const char * const pwc_ext_on_grp[] = { "pwc_ext_on_grp", };
  1075. static const char * const pwc_gpio3_clk_grp[] = { "pwc_gpio3_clk_grp", };
  1076. static const char * const pwc_io_on_grp[] = { "pwc_io_on_grp", };
  1077. static const char * const pwc_lowbatt_b_grp0[] = { "pwc_lowbatt_b_grp0", };
  1078. static const char * const pwc_mem_on_grp[] = { "pwc_mem_on_grp", };
  1079. static const char * const pwc_on_key_b_grp0[] = { "pwc_on_key_b_grp0", };
  1080. static const char * const pwc_wakeup_src0_grp[] = { "pwc_wakeup_src0_grp", };
  1081. static const char * const pwc_wakeup_src1_grp[] = { "pwc_wakeup_src1_grp", };
  1082. static const char * const pwc_wakeup_src2_grp[] = { "pwc_wakeup_src2_grp", };
  1083. static const char * const pwc_wakeup_src3_grp[] = { "pwc_wakeup_src3_grp", };
  1084. static const char * const pw_cko0_grp0[] = { "pw_cko0_grp0", };
  1085. static const char * const pw_cko0_grp1[] = { "pw_cko0_grp1", };
  1086. static const char * const pw_cko0_grp2[] = { "pw_cko0_grp2", };
  1087. static const char * const pw_cko1_grp0[] = { "pw_cko1_grp0", };
  1088. static const char * const pw_cko1_grp1[] = { "pw_cko1_grp1", };
  1089. static const char * const pw_i2s01_clk_grp0[] = { "pw_i2s01_clk_grp0", };
  1090. static const char * const pw_i2s01_clk_grp1[] = { "pw_i2s01_clk_grp1", };
  1091. static const char * const pw_pwm0_grp[] = { "pw_pwm0_grp", };
  1092. static const char * const pw_pwm1_grp[] = { "pw_pwm1_grp", };
  1093. static const char * const pw_pwm2_grp0[] = { "pw_pwm2_grp0", };
  1094. static const char * const pw_pwm2_grp1[] = { "pw_pwm2_grp1", };
  1095. static const char * const pw_pwm3_grp0[] = { "pw_pwm3_grp0", };
  1096. static const char * const pw_pwm3_grp1[] = { "pw_pwm3_grp1", };
  1097. static const char * const pw_pwm_cpu_vol_grp0[] = { "pw_pwm_cpu_vol_grp0", };
  1098. static const char * const pw_pwm_cpu_vol_grp1[] = { "pw_pwm_cpu_vol_grp1", };
  1099. static const char * const pw_backlight_grp0[] = { "pw_backlight_grp0", };
  1100. static const char * const pw_backlight_grp1[] = { "pw_backlight_grp1", };
  1101. static const char * const rg_eth_mac_grp[] = { "rg_eth_mac_grp", };
  1102. static const char * const rg_gmac_phy_intr_n_grp[] = {
  1103. "rg_gmac_phy_intr_n_grp", };
  1104. static const char * const rg_rgmii_mac_grp[] = { "rg_rgmii_mac_grp", };
  1105. static const char * const rg_rgmii_phy_ref_clk_grp0[] = {
  1106. "rg_rgmii_phy_ref_clk_grp0", };
  1107. static const char * const rg_rgmii_phy_ref_clk_grp1[] = {
  1108. "rg_rgmii_phy_ref_clk_grp1", };
  1109. static const char * const sd0_grp[] = { "sd0_grp", };
  1110. static const char * const sd0_4bit_grp[] = { "sd0_4bit_grp", };
  1111. static const char * const sd1_grp[] = { "sd1_grp", };
  1112. static const char * const sd1_4bit_grp0[] = { "sd1_4bit_grp0", };
  1113. static const char * const sd1_4bit_grp1[] = { "sd1_4bit_grp1", };
  1114. static const char * const sd2_grp0[] = { "sd2_grp0", };
  1115. static const char * const sd2_no_cdb_grp0[] = { "sd2_no_cdb_grp0", };
  1116. static const char * const sd3_grp[] = { "sd3_grp", };
  1117. static const char * const sd5_grp[] = { "sd5_grp", };
  1118. static const char * const sd6_grp0[] = { "sd6_grp0", };
  1119. static const char * const sd6_grp1[] = { "sd6_grp1", };
  1120. static const char * const sp0_ext_ldo_on_grp[] = { "sp0_ext_ldo_on_grp", };
  1121. static const char * const sp0_qspi_grp[] = { "sp0_qspi_grp", };
  1122. static const char * const sp1_spi_grp[] = { "sp1_spi_grp", };
  1123. static const char * const tpiu_trace_grp[] = { "tpiu_trace_grp", };
  1124. static const char * const uart0_grp[] = { "uart0_grp", };
  1125. static const char * const uart0_nopause_grp[] = { "uart0_nopause_grp", };
  1126. static const char * const uart1_grp[] = { "uart1_grp", };
  1127. static const char * const uart2_grp[] = { "uart2_grp", };
  1128. static const char * const uart3_grp0[] = { "uart3_grp0", };
  1129. static const char * const uart3_grp1[] = { "uart3_grp1", };
  1130. static const char * const uart3_grp2[] = { "uart3_grp2", };
  1131. static const char * const uart3_grp3[] = { "uart3_grp3", };
  1132. static const char * const uart3_nopause_grp0[] = { "uart3_nopause_grp0", };
  1133. static const char * const uart3_nopause_grp1[] = { "uart3_nopause_grp1", };
  1134. static const char * const uart4_grp0[] = { "uart4_grp0", };
  1135. static const char * const uart4_grp1[] = { "uart4_grp1", };
  1136. static const char * const uart4_grp2[] = { "uart4_grp2", };
  1137. static const char * const uart4_nopause_grp[] = { "uart4_nopause_grp", };
  1138. static const char * const usb0_drvvbus_grp[] = { "usb0_drvvbus_grp", };
  1139. static const char * const usb1_drvvbus_grp[] = { "usb1_drvvbus_grp", };
  1140. static const char * const visbus_dout_grp[] = { "visbus_dout_grp", };
  1141. static const char * const vi_vip1_grp[] = { "vi_vip1_grp", };
  1142. static const char * const vi_vip1_ext_grp[] = { "vi_vip1_ext_grp", };
  1143. static const char * const vi_vip1_low8bit_grp[] = { "vi_vip1_low8bit_grp", };
  1144. static const char * const vi_vip1_high8bit_grp[] = { "vi_vip1_high8bit_grp", };
  1145. static struct atlas7_pad_mux gnss_gpio_grp_pad_mux[] = {
  1146. MUX(1, 119, 0, N, N, N, N),
  1147. MUX(1, 120, 0, N, N, N, N),
  1148. MUX(1, 121, 0, N, N, N, N),
  1149. MUX(1, 122, 0, N, N, N, N),
  1150. MUX(1, 123, 0, N, N, N, N),
  1151. MUX(1, 124, 0, N, N, N, N),
  1152. MUX(1, 125, 0, N, N, N, N),
  1153. MUX(1, 126, 0, N, N, N, N),
  1154. MUX(1, 127, 0, N, N, N, N),
  1155. MUX(1, 128, 0, N, N, N, N),
  1156. MUX(1, 22, 0, N, N, N, N),
  1157. MUX(1, 23, 0, N, N, N, N),
  1158. MUX(1, 24, 0, N, N, N, N),
  1159. MUX(1, 25, 0, N, N, N, N),
  1160. MUX(1, 26, 0, N, N, N, N),
  1161. MUX(1, 27, 0, N, N, N, N),
  1162. MUX(1, 28, 0, N, N, N, N),
  1163. MUX(1, 29, 0, N, N, N, N),
  1164. MUX(1, 30, 0, N, N, N, N),
  1165. };
  1166. static struct atlas7_grp_mux gnss_gpio_grp_mux = {
  1167. .pad_mux_count = ARRAY_SIZE(gnss_gpio_grp_pad_mux),
  1168. .pad_mux_list = gnss_gpio_grp_pad_mux,
  1169. };
  1170. static struct atlas7_pad_mux lcd_vip_gpio_grp_pad_mux[] = {
  1171. MUX(1, 74, 0, N, N, N, N),
  1172. MUX(1, 75, 0, N, N, N, N),
  1173. MUX(1, 76, 0, N, N, N, N),
  1174. MUX(1, 77, 0, N, N, N, N),
  1175. MUX(1, 78, 0, N, N, N, N),
  1176. MUX(1, 79, 0, N, N, N, N),
  1177. MUX(1, 80, 0, N, N, N, N),
  1178. MUX(1, 81, 0, N, N, N, N),
  1179. MUX(1, 82, 0, N, N, N, N),
  1180. MUX(1, 83, 0, N, N, N, N),
  1181. MUX(1, 84, 0, N, N, N, N),
  1182. MUX(1, 53, 0, N, N, N, N),
  1183. MUX(1, 54, 0, N, N, N, N),
  1184. MUX(1, 55, 0, N, N, N, N),
  1185. MUX(1, 56, 0, N, N, N, N),
  1186. MUX(1, 57, 0, N, N, N, N),
  1187. MUX(1, 58, 0, N, N, N, N),
  1188. MUX(1, 59, 0, N, N, N, N),
  1189. MUX(1, 60, 0, N, N, N, N),
  1190. MUX(1, 61, 0, N, N, N, N),
  1191. MUX(1, 62, 0, N, N, N, N),
  1192. MUX(1, 63, 0, N, N, N, N),
  1193. MUX(1, 64, 0, N, N, N, N),
  1194. MUX(1, 65, 0, N, N, N, N),
  1195. MUX(1, 66, 0, N, N, N, N),
  1196. MUX(1, 67, 0, N, N, N, N),
  1197. MUX(1, 68, 0, N, N, N, N),
  1198. MUX(1, 69, 0, N, N, N, N),
  1199. MUX(1, 70, 0, N, N, N, N),
  1200. MUX(1, 71, 0, N, N, N, N),
  1201. MUX(1, 72, 0, N, N, N, N),
  1202. MUX(1, 73, 0, N, N, N, N),
  1203. };
  1204. static struct atlas7_grp_mux lcd_vip_gpio_grp_mux = {
  1205. .pad_mux_count = ARRAY_SIZE(lcd_vip_gpio_grp_pad_mux),
  1206. .pad_mux_list = lcd_vip_gpio_grp_pad_mux,
  1207. };
  1208. static struct atlas7_pad_mux sdio_i2s_gpio_grp_pad_mux[] = {
  1209. MUX(1, 31, 0, N, N, N, N),
  1210. MUX(1, 32, 0, N, N, N, N),
  1211. MUX(1, 33, 0, N, N, N, N),
  1212. MUX(1, 34, 0, N, N, N, N),
  1213. MUX(1, 35, 0, N, N, N, N),
  1214. MUX(1, 36, 0, N, N, N, N),
  1215. MUX(1, 85, 0, N, N, N, N),
  1216. MUX(1, 86, 0, N, N, N, N),
  1217. MUX(1, 87, 0, N, N, N, N),
  1218. MUX(1, 88, 0, N, N, N, N),
  1219. MUX(1, 89, 0, N, N, N, N),
  1220. MUX(1, 90, 0, N, N, N, N),
  1221. MUX(1, 129, 0, N, N, N, N),
  1222. MUX(1, 130, 0, N, N, N, N),
  1223. MUX(1, 131, 0, N, N, N, N),
  1224. MUX(1, 132, 0, N, N, N, N),
  1225. MUX(1, 91, 0, N, N, N, N),
  1226. MUX(1, 92, 0, N, N, N, N),
  1227. MUX(1, 93, 0, N, N, N, N),
  1228. MUX(1, 94, 0, N, N, N, N),
  1229. MUX(1, 95, 0, N, N, N, N),
  1230. MUX(1, 96, 0, N, N, N, N),
  1231. MUX(1, 112, 0, N, N, N, N),
  1232. MUX(1, 113, 0, N, N, N, N),
  1233. MUX(1, 114, 0, N, N, N, N),
  1234. MUX(1, 115, 0, N, N, N, N),
  1235. MUX(1, 116, 0, N, N, N, N),
  1236. MUX(1, 117, 0, N, N, N, N),
  1237. MUX(1, 118, 0, N, N, N, N),
  1238. };
  1239. static struct atlas7_grp_mux sdio_i2s_gpio_grp_mux = {
  1240. .pad_mux_count = ARRAY_SIZE(sdio_i2s_gpio_grp_pad_mux),
  1241. .pad_mux_list = sdio_i2s_gpio_grp_pad_mux,
  1242. };
  1243. static struct atlas7_pad_mux sp_rgmii_gpio_grp_pad_mux[] = {
  1244. MUX(1, 97, 0, N, N, N, N),
  1245. MUX(1, 98, 0, N, N, N, N),
  1246. MUX(1, 99, 0, N, N, N, N),
  1247. MUX(1, 100, 0, N, N, N, N),
  1248. MUX(1, 101, 0, N, N, N, N),
  1249. MUX(1, 102, 0, N, N, N, N),
  1250. MUX(1, 103, 0, N, N, N, N),
  1251. MUX(1, 104, 0, N, N, N, N),
  1252. MUX(1, 105, 0, N, N, N, N),
  1253. MUX(1, 106, 0, N, N, N, N),
  1254. MUX(1, 107, 0, N, N, N, N),
  1255. MUX(1, 108, 0, N, N, N, N),
  1256. MUX(1, 109, 0, N, N, N, N),
  1257. MUX(1, 110, 0, N, N, N, N),
  1258. MUX(1, 111, 0, N, N, N, N),
  1259. MUX(1, 18, 0, N, N, N, N),
  1260. MUX(1, 19, 0, N, N, N, N),
  1261. MUX(1, 20, 0, N, N, N, N),
  1262. MUX(1, 21, 0, N, N, N, N),
  1263. MUX(1, 141, 0, N, N, N, N),
  1264. MUX(1, 142, 0, N, N, N, N),
  1265. MUX(1, 143, 0, N, N, N, N),
  1266. MUX(1, 144, 0, N, N, N, N),
  1267. MUX(1, 145, 0, N, N, N, N),
  1268. MUX(1, 146, 0, N, N, N, N),
  1269. MUX(1, 147, 0, N, N, N, N),
  1270. MUX(1, 148, 0, N, N, N, N),
  1271. };
  1272. static struct atlas7_grp_mux sp_rgmii_gpio_grp_mux = {
  1273. .pad_mux_count = ARRAY_SIZE(sp_rgmii_gpio_grp_pad_mux),
  1274. .pad_mux_list = sp_rgmii_gpio_grp_pad_mux,
  1275. };
  1276. static struct atlas7_pad_mux lvds_gpio_grp_pad_mux[] = {
  1277. MUX(1, 157, 0, N, N, N, N),
  1278. MUX(1, 158, 0, N, N, N, N),
  1279. MUX(1, 155, 0, N, N, N, N),
  1280. MUX(1, 156, 0, N, N, N, N),
  1281. MUX(1, 153, 0, N, N, N, N),
  1282. MUX(1, 154, 0, N, N, N, N),
  1283. MUX(1, 151, 0, N, N, N, N),
  1284. MUX(1, 152, 0, N, N, N, N),
  1285. MUX(1, 149, 0, N, N, N, N),
  1286. MUX(1, 150, 0, N, N, N, N),
  1287. };
  1288. static struct atlas7_grp_mux lvds_gpio_grp_mux = {
  1289. .pad_mux_count = ARRAY_SIZE(lvds_gpio_grp_pad_mux),
  1290. .pad_mux_list = lvds_gpio_grp_pad_mux,
  1291. };
  1292. static struct atlas7_pad_mux uart_nand_gpio_grp_pad_mux[] = {
  1293. MUX(1, 44, 0, N, N, N, N),
  1294. MUX(1, 43, 0, N, N, N, N),
  1295. MUX(1, 42, 0, N, N, N, N),
  1296. MUX(1, 41, 0, N, N, N, N),
  1297. MUX(1, 40, 0, N, N, N, N),
  1298. MUX(1, 39, 0, N, N, N, N),
  1299. MUX(1, 38, 0, N, N, N, N),
  1300. MUX(1, 37, 0, N, N, N, N),
  1301. MUX(1, 46, 0, N, N, N, N),
  1302. MUX(1, 47, 0, N, N, N, N),
  1303. MUX(1, 48, 0, N, N, N, N),
  1304. MUX(1, 49, 0, N, N, N, N),
  1305. MUX(1, 50, 0, N, N, N, N),
  1306. MUX(1, 52, 0, N, N, N, N),
  1307. MUX(1, 51, 0, N, N, N, N),
  1308. MUX(1, 45, 0, N, N, N, N),
  1309. MUX(1, 133, 0, N, N, N, N),
  1310. MUX(1, 134, 0, N, N, N, N),
  1311. MUX(1, 135, 0, N, N, N, N),
  1312. MUX(1, 136, 0, N, N, N, N),
  1313. MUX(1, 137, 0, N, N, N, N),
  1314. MUX(1, 138, 0, N, N, N, N),
  1315. MUX(1, 139, 0, N, N, N, N),
  1316. MUX(1, 140, 0, N, N, N, N),
  1317. };
  1318. static struct atlas7_grp_mux uart_nand_gpio_grp_mux = {
  1319. .pad_mux_count = ARRAY_SIZE(uart_nand_gpio_grp_pad_mux),
  1320. .pad_mux_list = uart_nand_gpio_grp_pad_mux,
  1321. };
  1322. static struct atlas7_pad_mux rtc_gpio_grp_pad_mux[] = {
  1323. MUX(0, 0, 0, N, N, N, N),
  1324. MUX(0, 1, 0, N, N, N, N),
  1325. MUX(0, 2, 0, N, N, N, N),
  1326. MUX(0, 3, 0, N, N, N, N),
  1327. MUX(0, 4, 0, N, N, N, N),
  1328. MUX(0, 10, 0, N, N, N, N),
  1329. MUX(0, 11, 0, N, N, N, N),
  1330. MUX(0, 12, 0, N, N, N, N),
  1331. MUX(0, 13, 0, N, N, N, N),
  1332. MUX(0, 14, 0, N, N, N, N),
  1333. MUX(0, 15, 0, N, N, N, N),
  1334. MUX(0, 16, 0, N, N, N, N),
  1335. MUX(0, 17, 0, N, N, N, N),
  1336. };
  1337. static struct atlas7_grp_mux rtc_gpio_grp_mux = {
  1338. .pad_mux_count = ARRAY_SIZE(rtc_gpio_grp_pad_mux),
  1339. .pad_mux_list = rtc_gpio_grp_pad_mux,
  1340. };
  1341. static struct atlas7_pad_mux audio_ac97_grp_pad_mux[] = {
  1342. MUX(1, 113, 2, N, N, N, N),
  1343. MUX(1, 118, 2, N, N, N, N),
  1344. MUX(1, 115, 2, N, N, N, N),
  1345. MUX(1, 114, 2, N, N, N, N),
  1346. };
  1347. static struct atlas7_grp_mux audio_ac97_grp_mux = {
  1348. .pad_mux_count = ARRAY_SIZE(audio_ac97_grp_pad_mux),
  1349. .pad_mux_list = audio_ac97_grp_pad_mux,
  1350. };
  1351. static struct atlas7_pad_mux audio_func_dbg_grp_pad_mux[] = {
  1352. MUX(1, 141, 4, N, N, N, N),
  1353. MUX(1, 144, 4, N, N, N, N),
  1354. MUX(1, 44, 6, N, N, N, N),
  1355. MUX(1, 43, 6, N, N, N, N),
  1356. MUX(1, 42, 6, N, N, N, N),
  1357. MUX(1, 41, 6, N, N, N, N),
  1358. MUX(1, 40, 6, N, N, N, N),
  1359. MUX(1, 39, 6, N, N, N, N),
  1360. MUX(1, 38, 6, N, N, N, N),
  1361. MUX(1, 37, 6, N, N, N, N),
  1362. MUX(1, 74, 6, N, N, N, N),
  1363. MUX(1, 75, 6, N, N, N, N),
  1364. MUX(1, 76, 6, N, N, N, N),
  1365. MUX(1, 77, 6, N, N, N, N),
  1366. MUX(1, 78, 6, N, N, N, N),
  1367. MUX(1, 79, 6, N, N, N, N),
  1368. MUX(1, 81, 6, N, N, N, N),
  1369. MUX(1, 113, 6, N, N, N, N),
  1370. MUX(1, 114, 6, N, N, N, N),
  1371. MUX(1, 118, 6, N, N, N, N),
  1372. MUX(1, 115, 6, N, N, N, N),
  1373. MUX(1, 49, 6, N, N, N, N),
  1374. MUX(1, 50, 6, N, N, N, N),
  1375. MUX(1, 142, 4, N, N, N, N),
  1376. MUX(1, 143, 4, N, N, N, N),
  1377. MUX(1, 80, 6, N, N, N, N),
  1378. };
  1379. static struct atlas7_grp_mux audio_func_dbg_grp_mux = {
  1380. .pad_mux_count = ARRAY_SIZE(audio_func_dbg_grp_pad_mux),
  1381. .pad_mux_list = audio_func_dbg_grp_pad_mux,
  1382. };
  1383. static struct atlas7_pad_mux audio_i2s_grp_pad_mux[] = {
  1384. MUX(1, 118, 1, N, N, N, N),
  1385. MUX(1, 115, 1, N, N, N, N),
  1386. MUX(1, 116, 1, N, N, N, N),
  1387. MUX(1, 117, 1, N, N, N, N),
  1388. MUX(1, 112, 1, N, N, N, N),
  1389. MUX(1, 113, 1, N, N, N, N),
  1390. MUX(1, 114, 1, N, N, N, N),
  1391. };
  1392. static struct atlas7_grp_mux audio_i2s_grp_mux = {
  1393. .pad_mux_count = ARRAY_SIZE(audio_i2s_grp_pad_mux),
  1394. .pad_mux_list = audio_i2s_grp_pad_mux,
  1395. };
  1396. static struct atlas7_pad_mux audio_i2s_2ch_grp_pad_mux[] = {
  1397. MUX(1, 118, 1, N, N, N, N),
  1398. MUX(1, 115, 1, N, N, N, N),
  1399. MUX(1, 112, 1, N, N, N, N),
  1400. MUX(1, 113, 1, N, N, N, N),
  1401. MUX(1, 114, 1, N, N, N, N),
  1402. };
  1403. static struct atlas7_grp_mux audio_i2s_2ch_grp_mux = {
  1404. .pad_mux_count = ARRAY_SIZE(audio_i2s_2ch_grp_pad_mux),
  1405. .pad_mux_list = audio_i2s_2ch_grp_pad_mux,
  1406. };
  1407. static struct atlas7_pad_mux audio_i2s_extclk_grp_pad_mux[] = {
  1408. MUX(1, 112, 2, N, N, N, N),
  1409. };
  1410. static struct atlas7_grp_mux audio_i2s_extclk_grp_mux = {
  1411. .pad_mux_count = ARRAY_SIZE(audio_i2s_extclk_grp_pad_mux),
  1412. .pad_mux_list = audio_i2s_extclk_grp_pad_mux,
  1413. };
  1414. static struct atlas7_pad_mux audio_uart0_grp_pad_mux[] = {
  1415. MUX(1, 143, 1, N, N, N, N),
  1416. MUX(1, 142, 1, N, N, N, N),
  1417. MUX(1, 141, 1, N, N, N, N),
  1418. MUX(1, 144, 1, N, N, N, N),
  1419. };
  1420. static struct atlas7_grp_mux audio_uart0_grp_mux = {
  1421. .pad_mux_count = ARRAY_SIZE(audio_uart0_grp_pad_mux),
  1422. .pad_mux_list = audio_uart0_grp_pad_mux,
  1423. };
  1424. static struct atlas7_pad_mux audio_uart1_grp_pad_mux[] = {
  1425. MUX(1, 147, 1, N, N, N, N),
  1426. MUX(1, 146, 1, N, N, N, N),
  1427. MUX(1, 145, 1, N, N, N, N),
  1428. MUX(1, 148, 1, N, N, N, N),
  1429. };
  1430. static struct atlas7_grp_mux audio_uart1_grp_mux = {
  1431. .pad_mux_count = ARRAY_SIZE(audio_uart1_grp_pad_mux),
  1432. .pad_mux_list = audio_uart1_grp_pad_mux,
  1433. };
  1434. static struct atlas7_pad_mux audio_uart2_grp0_pad_mux[] = {
  1435. MUX(1, 20, 2, 0xa00, 24, 0xa80, 24),
  1436. MUX(1, 21, 2, 0xa00, 25, 0xa80, 25),
  1437. MUX(1, 19, 2, 0xa00, 23, 0xa80, 23),
  1438. MUX(1, 18, 2, 0xa00, 22, 0xa80, 22),
  1439. };
  1440. static struct atlas7_grp_mux audio_uart2_grp0_mux = {
  1441. .pad_mux_count = ARRAY_SIZE(audio_uart2_grp0_pad_mux),
  1442. .pad_mux_list = audio_uart2_grp0_pad_mux,
  1443. };
  1444. static struct atlas7_pad_mux audio_uart2_grp1_pad_mux[] = {
  1445. MUX(1, 109, 2, 0xa00, 24, 0xa80, 24),
  1446. MUX(1, 110, 2, 0xa00, 25, 0xa80, 25),
  1447. MUX(1, 101, 2, 0xa00, 23, 0xa80, 23),
  1448. MUX(1, 111, 2, 0xa00, 22, 0xa80, 22),
  1449. };
  1450. static struct atlas7_grp_mux audio_uart2_grp1_mux = {
  1451. .pad_mux_count = ARRAY_SIZE(audio_uart2_grp1_pad_mux),
  1452. .pad_mux_list = audio_uart2_grp1_pad_mux,
  1453. };
  1454. static struct atlas7_pad_mux c_can_trnsvr_grp_pad_mux[] = {
  1455. MUX(0, 1, 2, N, N, N, N),
  1456. };
  1457. static struct atlas7_grp_mux c_can_trnsvr_grp_mux = {
  1458. .pad_mux_count = ARRAY_SIZE(c_can_trnsvr_grp_pad_mux),
  1459. .pad_mux_list = c_can_trnsvr_grp_pad_mux,
  1460. };
  1461. static struct atlas7_pad_mux c0_can_grp0_pad_mux[] = {
  1462. MUX(0, 11, 1, 0xa08, 9, 0xa88, 9),
  1463. MUX(0, 10, 1, N, N, N, N),
  1464. };
  1465. static struct atlas7_grp_mux c0_can_grp0_mux = {
  1466. .pad_mux_count = ARRAY_SIZE(c0_can_grp0_pad_mux),
  1467. .pad_mux_list = c0_can_grp0_pad_mux,
  1468. };
  1469. static struct atlas7_pad_mux c0_can_grp1_pad_mux[] = {
  1470. MUX(0, 2, 5, 0xa08, 9, 0xa88, 9),
  1471. MUX(0, 3, 5, N, N, N, N),
  1472. };
  1473. static struct atlas7_grp_mux c0_can_grp1_mux = {
  1474. .pad_mux_count = ARRAY_SIZE(c0_can_grp1_pad_mux),
  1475. .pad_mux_list = c0_can_grp1_pad_mux,
  1476. };
  1477. static struct atlas7_pad_mux c1_can_grp0_pad_mux[] = {
  1478. MUX(1, 138, 2, 0xa00, 4, 0xa80, 4),
  1479. MUX(1, 137, 2, N, N, N, N),
  1480. };
  1481. static struct atlas7_grp_mux c1_can_grp0_mux = {
  1482. .pad_mux_count = ARRAY_SIZE(c1_can_grp0_pad_mux),
  1483. .pad_mux_list = c1_can_grp0_pad_mux,
  1484. };
  1485. static struct atlas7_pad_mux c1_can_grp1_pad_mux[] = {
  1486. MUX(1, 147, 2, 0xa00, 4, 0xa80, 4),
  1487. MUX(1, 146, 2, N, N, N, N),
  1488. };
  1489. static struct atlas7_grp_mux c1_can_grp1_mux = {
  1490. .pad_mux_count = ARRAY_SIZE(c1_can_grp1_pad_mux),
  1491. .pad_mux_list = c1_can_grp1_pad_mux,
  1492. };
  1493. static struct atlas7_pad_mux c1_can_grp2_pad_mux[] = {
  1494. MUX(0, 2, 2, 0xa00, 4, 0xa80, 4),
  1495. MUX(0, 3, 2, N, N, N, N),
  1496. };
  1497. static struct atlas7_grp_mux c1_can_grp2_mux = {
  1498. .pad_mux_count = ARRAY_SIZE(c1_can_grp2_pad_mux),
  1499. .pad_mux_list = c1_can_grp2_pad_mux,
  1500. };
  1501. static struct atlas7_pad_mux ca_audio_lpc_grp_pad_mux[] = {
  1502. MUX(1, 62, 4, N, N, N, N),
  1503. MUX(1, 63, 4, N, N, N, N),
  1504. MUX(1, 64, 4, N, N, N, N),
  1505. MUX(1, 65, 4, N, N, N, N),
  1506. MUX(1, 66, 4, N, N, N, N),
  1507. MUX(1, 67, 4, N, N, N, N),
  1508. MUX(1, 68, 4, N, N, N, N),
  1509. MUX(1, 69, 4, N, N, N, N),
  1510. MUX(1, 70, 4, N, N, N, N),
  1511. MUX(1, 71, 4, N, N, N, N),
  1512. };
  1513. static struct atlas7_grp_mux ca_audio_lpc_grp_mux = {
  1514. .pad_mux_count = ARRAY_SIZE(ca_audio_lpc_grp_pad_mux),
  1515. .pad_mux_list = ca_audio_lpc_grp_pad_mux,
  1516. };
  1517. static struct atlas7_pad_mux ca_bt_lpc_grp_pad_mux[] = {
  1518. MUX(1, 85, 5, N, N, N, N),
  1519. MUX(1, 86, 5, N, N, N, N),
  1520. MUX(1, 87, 5, N, N, N, N),
  1521. MUX(1, 88, 5, N, N, N, N),
  1522. MUX(1, 89, 5, N, N, N, N),
  1523. MUX(1, 90, 5, N, N, N, N),
  1524. };
  1525. static struct atlas7_grp_mux ca_bt_lpc_grp_mux = {
  1526. .pad_mux_count = ARRAY_SIZE(ca_bt_lpc_grp_pad_mux),
  1527. .pad_mux_list = ca_bt_lpc_grp_pad_mux,
  1528. };
  1529. static struct atlas7_pad_mux ca_coex_grp_pad_mux[] = {
  1530. MUX(1, 129, 1, N, N, N, N),
  1531. MUX(1, 130, 1, N, N, N, N),
  1532. MUX(1, 131, 1, N, N, N, N),
  1533. MUX(1, 132, 1, N, N, N, N),
  1534. };
  1535. static struct atlas7_grp_mux ca_coex_grp_mux = {
  1536. .pad_mux_count = ARRAY_SIZE(ca_coex_grp_pad_mux),
  1537. .pad_mux_list = ca_coex_grp_pad_mux,
  1538. };
  1539. static struct atlas7_pad_mux ca_curator_lpc_grp_pad_mux[] = {
  1540. MUX(1, 57, 4, N, N, N, N),
  1541. MUX(1, 58, 4, N, N, N, N),
  1542. MUX(1, 59, 4, N, N, N, N),
  1543. MUX(1, 60, 4, N, N, N, N),
  1544. };
  1545. static struct atlas7_grp_mux ca_curator_lpc_grp_mux = {
  1546. .pad_mux_count = ARRAY_SIZE(ca_curator_lpc_grp_pad_mux),
  1547. .pad_mux_list = ca_curator_lpc_grp_pad_mux,
  1548. };
  1549. static struct atlas7_pad_mux ca_pcm_debug_grp_pad_mux[] = {
  1550. MUX(1, 91, 5, N, N, N, N),
  1551. MUX(1, 93, 5, N, N, N, N),
  1552. MUX(1, 94, 5, N, N, N, N),
  1553. MUX(1, 92, 5, N, N, N, N),
  1554. };
  1555. static struct atlas7_grp_mux ca_pcm_debug_grp_mux = {
  1556. .pad_mux_count = ARRAY_SIZE(ca_pcm_debug_grp_pad_mux),
  1557. .pad_mux_list = ca_pcm_debug_grp_pad_mux,
  1558. };
  1559. static struct atlas7_pad_mux ca_pio_grp_pad_mux[] = {
  1560. MUX(1, 121, 2, N, N, N, N),
  1561. MUX(1, 122, 2, N, N, N, N),
  1562. MUX(1, 125, 6, N, N, N, N),
  1563. MUX(1, 126, 6, N, N, N, N),
  1564. MUX(1, 38, 5, N, N, N, N),
  1565. MUX(1, 37, 5, N, N, N, N),
  1566. MUX(1, 47, 5, N, N, N, N),
  1567. MUX(1, 49, 5, N, N, N, N),
  1568. MUX(1, 50, 5, N, N, N, N),
  1569. MUX(1, 54, 4, N, N, N, N),
  1570. MUX(1, 55, 4, N, N, N, N),
  1571. MUX(1, 56, 4, N, N, N, N),
  1572. };
  1573. static struct atlas7_grp_mux ca_pio_grp_mux = {
  1574. .pad_mux_count = ARRAY_SIZE(ca_pio_grp_pad_mux),
  1575. .pad_mux_list = ca_pio_grp_pad_mux,
  1576. };
  1577. static struct atlas7_pad_mux ca_sdio_debug_grp_pad_mux[] = {
  1578. MUX(1, 40, 5, N, N, N, N),
  1579. MUX(1, 39, 5, N, N, N, N),
  1580. MUX(1, 44, 5, N, N, N, N),
  1581. MUX(1, 43, 5, N, N, N, N),
  1582. MUX(1, 42, 5, N, N, N, N),
  1583. MUX(1, 41, 5, N, N, N, N),
  1584. };
  1585. static struct atlas7_grp_mux ca_sdio_debug_grp_mux = {
  1586. .pad_mux_count = ARRAY_SIZE(ca_sdio_debug_grp_pad_mux),
  1587. .pad_mux_list = ca_sdio_debug_grp_pad_mux,
  1588. };
  1589. static struct atlas7_pad_mux ca_spi_grp_pad_mux[] = {
  1590. MUX(1, 82, 5, N, N, N, N),
  1591. MUX(1, 79, 5, 0xa08, 6, 0xa88, 6),
  1592. MUX(1, 80, 5, N, N, N, N),
  1593. MUX(1, 81, 5, N, N, N, N),
  1594. };
  1595. static struct atlas7_grp_mux ca_spi_grp_mux = {
  1596. .pad_mux_count = ARRAY_SIZE(ca_spi_grp_pad_mux),
  1597. .pad_mux_list = ca_spi_grp_pad_mux,
  1598. };
  1599. static struct atlas7_pad_mux ca_trb_grp_pad_mux[] = {
  1600. MUX(1, 91, 4, N, N, N, N),
  1601. MUX(1, 93, 4, N, N, N, N),
  1602. MUX(1, 94, 4, N, N, N, N),
  1603. MUX(1, 95, 4, N, N, N, N),
  1604. MUX(1, 96, 4, N, N, N, N),
  1605. MUX(1, 78, 5, N, N, N, N),
  1606. MUX(1, 74, 5, N, N, N, N),
  1607. MUX(1, 75, 5, N, N, N, N),
  1608. MUX(1, 76, 5, N, N, N, N),
  1609. MUX(1, 77, 5, N, N, N, N),
  1610. };
  1611. static struct atlas7_grp_mux ca_trb_grp_mux = {
  1612. .pad_mux_count = ARRAY_SIZE(ca_trb_grp_pad_mux),
  1613. .pad_mux_list = ca_trb_grp_pad_mux,
  1614. };
  1615. static struct atlas7_pad_mux ca_uart_debug_grp_pad_mux[] = {
  1616. MUX(1, 136, 3, N, N, N, N),
  1617. MUX(1, 135, 3, N, N, N, N),
  1618. MUX(1, 134, 3, N, N, N, N),
  1619. MUX(1, 133, 3, N, N, N, N),
  1620. };
  1621. static struct atlas7_grp_mux ca_uart_debug_grp_mux = {
  1622. .pad_mux_count = ARRAY_SIZE(ca_uart_debug_grp_pad_mux),
  1623. .pad_mux_list = ca_uart_debug_grp_pad_mux,
  1624. };
  1625. static struct atlas7_pad_mux clkc_grp0_pad_mux[] = {
  1626. MUX(1, 30, 2, 0xa08, 14, 0xa88, 14),
  1627. MUX(1, 47, 6, N, N, N, N),
  1628. };
  1629. static struct atlas7_grp_mux clkc_grp0_mux = {
  1630. .pad_mux_count = ARRAY_SIZE(clkc_grp0_pad_mux),
  1631. .pad_mux_list = clkc_grp0_pad_mux,
  1632. };
  1633. static struct atlas7_pad_mux clkc_grp1_pad_mux[] = {
  1634. MUX(1, 78, 3, 0xa08, 14, 0xa88, 14),
  1635. MUX(1, 54, 5, N, N, N, N),
  1636. };
  1637. static struct atlas7_grp_mux clkc_grp1_mux = {
  1638. .pad_mux_count = ARRAY_SIZE(clkc_grp1_pad_mux),
  1639. .pad_mux_list = clkc_grp1_pad_mux,
  1640. };
  1641. static struct atlas7_pad_mux gn_gnss_i2c_grp_pad_mux[] = {
  1642. MUX(1, 128, 2, N, N, N, N),
  1643. MUX(1, 127, 2, N, N, N, N),
  1644. };
  1645. static struct atlas7_grp_mux gn_gnss_i2c_grp_mux = {
  1646. .pad_mux_count = ARRAY_SIZE(gn_gnss_i2c_grp_pad_mux),
  1647. .pad_mux_list = gn_gnss_i2c_grp_pad_mux,
  1648. };
  1649. static struct atlas7_pad_mux gn_gnss_uart_nopause_grp_pad_mux[] = {
  1650. MUX(1, 134, 4, N, N, N, N),
  1651. MUX(1, 133, 4, N, N, N, N),
  1652. };
  1653. static struct atlas7_grp_mux gn_gnss_uart_nopause_grp_mux = {
  1654. .pad_mux_count = ARRAY_SIZE(gn_gnss_uart_nopause_grp_pad_mux),
  1655. .pad_mux_list = gn_gnss_uart_nopause_grp_pad_mux,
  1656. };
  1657. static struct atlas7_pad_mux gn_gnss_uart_grp_pad_mux[] = {
  1658. MUX(1, 134, 4, N, N, N, N),
  1659. MUX(1, 133, 4, N, N, N, N),
  1660. MUX(1, 136, 4, N, N, N, N),
  1661. MUX(1, 135, 4, N, N, N, N),
  1662. };
  1663. static struct atlas7_grp_mux gn_gnss_uart_grp_mux = {
  1664. .pad_mux_count = ARRAY_SIZE(gn_gnss_uart_grp_pad_mux),
  1665. .pad_mux_list = gn_gnss_uart_grp_pad_mux,
  1666. };
  1667. static struct atlas7_pad_mux gn_trg_spi_grp0_pad_mux[] = {
  1668. MUX(1, 22, 1, N, N, N, N),
  1669. MUX(1, 25, 1, N, N, N, N),
  1670. MUX(1, 23, 1, 0xa00, 10, 0xa80, 10),
  1671. MUX(1, 24, 1, N, N, N, N),
  1672. };
  1673. static struct atlas7_grp_mux gn_trg_spi_grp0_mux = {
  1674. .pad_mux_count = ARRAY_SIZE(gn_trg_spi_grp0_pad_mux),
  1675. .pad_mux_list = gn_trg_spi_grp0_pad_mux,
  1676. };
  1677. static struct atlas7_pad_mux gn_trg_spi_grp1_pad_mux[] = {
  1678. MUX(1, 82, 3, N, N, N, N),
  1679. MUX(1, 79, 3, N, N, N, N),
  1680. MUX(1, 80, 3, 0xa00, 10, 0xa80, 10),
  1681. MUX(1, 81, 3, N, N, N, N),
  1682. };
  1683. static struct atlas7_grp_mux gn_trg_spi_grp1_mux = {
  1684. .pad_mux_count = ARRAY_SIZE(gn_trg_spi_grp1_pad_mux),
  1685. .pad_mux_list = gn_trg_spi_grp1_pad_mux,
  1686. };
  1687. static struct atlas7_pad_mux cvbs_dbg_grp_pad_mux[] = {
  1688. MUX(1, 54, 3, N, N, N, N),
  1689. MUX(1, 53, 3, N, N, N, N),
  1690. MUX(1, 82, 7, N, N, N, N),
  1691. MUX(1, 74, 7, N, N, N, N),
  1692. MUX(1, 75, 7, N, N, N, N),
  1693. MUX(1, 76, 7, N, N, N, N),
  1694. MUX(1, 77, 7, N, N, N, N),
  1695. MUX(1, 78, 7, N, N, N, N),
  1696. MUX(1, 79, 7, N, N, N, N),
  1697. MUX(1, 80, 7, N, N, N, N),
  1698. MUX(1, 81, 7, N, N, N, N),
  1699. MUX(1, 83, 7, N, N, N, N),
  1700. MUX(1, 84, 7, N, N, N, N),
  1701. MUX(1, 73, 3, N, N, N, N),
  1702. MUX(1, 55, 3, N, N, N, N),
  1703. MUX(1, 56, 3, N, N, N, N),
  1704. };
  1705. static struct atlas7_grp_mux cvbs_dbg_grp_mux = {
  1706. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_grp_pad_mux),
  1707. .pad_mux_list = cvbs_dbg_grp_pad_mux,
  1708. };
  1709. static struct atlas7_pad_mux cvbs_dbg_test_grp0_pad_mux[] = {
  1710. MUX(1, 57, 3, N, N, N, N),
  1711. };
  1712. static struct atlas7_grp_mux cvbs_dbg_test_grp0_mux = {
  1713. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp0_pad_mux),
  1714. .pad_mux_list = cvbs_dbg_test_grp0_pad_mux,
  1715. };
  1716. static struct atlas7_pad_mux cvbs_dbg_test_grp1_pad_mux[] = {
  1717. MUX(1, 58, 3, N, N, N, N),
  1718. };
  1719. static struct atlas7_grp_mux cvbs_dbg_test_grp1_mux = {
  1720. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp1_pad_mux),
  1721. .pad_mux_list = cvbs_dbg_test_grp1_pad_mux,
  1722. };
  1723. static struct atlas7_pad_mux cvbs_dbg_test_grp2_pad_mux[] = {
  1724. MUX(1, 59, 3, N, N, N, N),
  1725. };
  1726. static struct atlas7_grp_mux cvbs_dbg_test_grp2_mux = {
  1727. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp2_pad_mux),
  1728. .pad_mux_list = cvbs_dbg_test_grp2_pad_mux,
  1729. };
  1730. static struct atlas7_pad_mux cvbs_dbg_test_grp3_pad_mux[] = {
  1731. MUX(1, 60, 3, N, N, N, N),
  1732. };
  1733. static struct atlas7_grp_mux cvbs_dbg_test_grp3_mux = {
  1734. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp3_pad_mux),
  1735. .pad_mux_list = cvbs_dbg_test_grp3_pad_mux,
  1736. };
  1737. static struct atlas7_pad_mux cvbs_dbg_test_grp4_pad_mux[] = {
  1738. MUX(1, 61, 3, N, N, N, N),
  1739. };
  1740. static struct atlas7_grp_mux cvbs_dbg_test_grp4_mux = {
  1741. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp4_pad_mux),
  1742. .pad_mux_list = cvbs_dbg_test_grp4_pad_mux,
  1743. };
  1744. static struct atlas7_pad_mux cvbs_dbg_test_grp5_pad_mux[] = {
  1745. MUX(1, 62, 3, N, N, N, N),
  1746. };
  1747. static struct atlas7_grp_mux cvbs_dbg_test_grp5_mux = {
  1748. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp5_pad_mux),
  1749. .pad_mux_list = cvbs_dbg_test_grp5_pad_mux,
  1750. };
  1751. static struct atlas7_pad_mux cvbs_dbg_test_grp6_pad_mux[] = {
  1752. MUX(1, 63, 3, N, N, N, N),
  1753. };
  1754. static struct atlas7_grp_mux cvbs_dbg_test_grp6_mux = {
  1755. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp6_pad_mux),
  1756. .pad_mux_list = cvbs_dbg_test_grp6_pad_mux,
  1757. };
  1758. static struct atlas7_pad_mux cvbs_dbg_test_grp7_pad_mux[] = {
  1759. MUX(1, 64, 3, N, N, N, N),
  1760. };
  1761. static struct atlas7_grp_mux cvbs_dbg_test_grp7_mux = {
  1762. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp7_pad_mux),
  1763. .pad_mux_list = cvbs_dbg_test_grp7_pad_mux,
  1764. };
  1765. static struct atlas7_pad_mux cvbs_dbg_test_grp8_pad_mux[] = {
  1766. MUX(1, 65, 3, N, N, N, N),
  1767. };
  1768. static struct atlas7_grp_mux cvbs_dbg_test_grp8_mux = {
  1769. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp8_pad_mux),
  1770. .pad_mux_list = cvbs_dbg_test_grp8_pad_mux,
  1771. };
  1772. static struct atlas7_pad_mux cvbs_dbg_test_grp9_pad_mux[] = {
  1773. MUX(1, 66, 3, N, N, N, N),
  1774. };
  1775. static struct atlas7_grp_mux cvbs_dbg_test_grp9_mux = {
  1776. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp9_pad_mux),
  1777. .pad_mux_list = cvbs_dbg_test_grp9_pad_mux,
  1778. };
  1779. static struct atlas7_pad_mux cvbs_dbg_test_grp10_pad_mux[] = {
  1780. MUX(1, 67, 3, N, N, N, N),
  1781. };
  1782. static struct atlas7_grp_mux cvbs_dbg_test_grp10_mux = {
  1783. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp10_pad_mux),
  1784. .pad_mux_list = cvbs_dbg_test_grp10_pad_mux,
  1785. };
  1786. static struct atlas7_pad_mux cvbs_dbg_test_grp11_pad_mux[] = {
  1787. MUX(1, 68, 3, N, N, N, N),
  1788. };
  1789. static struct atlas7_grp_mux cvbs_dbg_test_grp11_mux = {
  1790. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp11_pad_mux),
  1791. .pad_mux_list = cvbs_dbg_test_grp11_pad_mux,
  1792. };
  1793. static struct atlas7_pad_mux cvbs_dbg_test_grp12_pad_mux[] = {
  1794. MUX(1, 69, 3, N, N, N, N),
  1795. };
  1796. static struct atlas7_grp_mux cvbs_dbg_test_grp12_mux = {
  1797. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp12_pad_mux),
  1798. .pad_mux_list = cvbs_dbg_test_grp12_pad_mux,
  1799. };
  1800. static struct atlas7_pad_mux cvbs_dbg_test_grp13_pad_mux[] = {
  1801. MUX(1, 70, 3, N, N, N, N),
  1802. };
  1803. static struct atlas7_grp_mux cvbs_dbg_test_grp13_mux = {
  1804. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp13_pad_mux),
  1805. .pad_mux_list = cvbs_dbg_test_grp13_pad_mux,
  1806. };
  1807. static struct atlas7_pad_mux cvbs_dbg_test_grp14_pad_mux[] = {
  1808. MUX(1, 71, 3, N, N, N, N),
  1809. };
  1810. static struct atlas7_grp_mux cvbs_dbg_test_grp14_mux = {
  1811. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp14_pad_mux),
  1812. .pad_mux_list = cvbs_dbg_test_grp14_pad_mux,
  1813. };
  1814. static struct atlas7_pad_mux cvbs_dbg_test_grp15_pad_mux[] = {
  1815. MUX(1, 72, 3, N, N, N, N),
  1816. };
  1817. static struct atlas7_grp_mux cvbs_dbg_test_grp15_mux = {
  1818. .pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp15_pad_mux),
  1819. .pad_mux_list = cvbs_dbg_test_grp15_pad_mux,
  1820. };
  1821. static struct atlas7_pad_mux gn_gnss_power_grp_pad_mux[] = {
  1822. MUX(1, 123, 7, N, N, N, N),
  1823. MUX(1, 124, 7, N, N, N, N),
  1824. MUX(1, 121, 7, N, N, N, N),
  1825. MUX(1, 122, 7, N, N, N, N),
  1826. MUX(1, 125, 7, N, N, N, N),
  1827. MUX(1, 120, 7, N, N, N, N),
  1828. };
  1829. static struct atlas7_grp_mux gn_gnss_power_grp_mux = {
  1830. .pad_mux_count = ARRAY_SIZE(gn_gnss_power_grp_pad_mux),
  1831. .pad_mux_list = gn_gnss_power_grp_pad_mux,
  1832. };
  1833. static struct atlas7_pad_mux gn_gnss_sw_status_grp_pad_mux[] = {
  1834. MUX(1, 57, 7, N, N, N, N),
  1835. MUX(1, 58, 7, N, N, N, N),
  1836. MUX(1, 59, 7, N, N, N, N),
  1837. MUX(1, 60, 7, N, N, N, N),
  1838. MUX(1, 61, 7, N, N, N, N),
  1839. MUX(1, 62, 7, N, N, N, N),
  1840. MUX(1, 63, 7, N, N, N, N),
  1841. MUX(1, 64, 7, N, N, N, N),
  1842. MUX(1, 65, 7, N, N, N, N),
  1843. MUX(1, 66, 7, N, N, N, N),
  1844. MUX(1, 67, 7, N, N, N, N),
  1845. MUX(1, 68, 7, N, N, N, N),
  1846. MUX(1, 69, 7, N, N, N, N),
  1847. MUX(1, 70, 7, N, N, N, N),
  1848. MUX(1, 71, 7, N, N, N, N),
  1849. MUX(1, 72, 7, N, N, N, N),
  1850. MUX(1, 53, 7, N, N, N, N),
  1851. MUX(1, 55, 7, N, N, N, N),
  1852. MUX(1, 56, 7, 0xa08, 12, 0xa88, 12),
  1853. MUX(1, 54, 7, N, N, N, N),
  1854. };
  1855. static struct atlas7_grp_mux gn_gnss_sw_status_grp_mux = {
  1856. .pad_mux_count = ARRAY_SIZE(gn_gnss_sw_status_grp_pad_mux),
  1857. .pad_mux_list = gn_gnss_sw_status_grp_pad_mux,
  1858. };
  1859. static struct atlas7_pad_mux gn_gnss_eclk_grp_pad_mux[] = {
  1860. MUX(1, 113, 4, N, N, N, N),
  1861. };
  1862. static struct atlas7_grp_mux gn_gnss_eclk_grp_mux = {
  1863. .pad_mux_count = ARRAY_SIZE(gn_gnss_eclk_grp_pad_mux),
  1864. .pad_mux_list = gn_gnss_eclk_grp_pad_mux,
  1865. };
  1866. static struct atlas7_pad_mux gn_gnss_irq1_grp0_pad_mux[] = {
  1867. MUX(1, 112, 4, 0xa08, 10, 0xa88, 10),
  1868. };
  1869. static struct atlas7_grp_mux gn_gnss_irq1_grp0_mux = {
  1870. .pad_mux_count = ARRAY_SIZE(gn_gnss_irq1_grp0_pad_mux),
  1871. .pad_mux_list = gn_gnss_irq1_grp0_pad_mux,
  1872. };
  1873. static struct atlas7_pad_mux gn_gnss_irq2_grp0_pad_mux[] = {
  1874. MUX(1, 118, 4, 0xa08, 11, 0xa88, 11),
  1875. };
  1876. static struct atlas7_grp_mux gn_gnss_irq2_grp0_mux = {
  1877. .pad_mux_count = ARRAY_SIZE(gn_gnss_irq2_grp0_pad_mux),
  1878. .pad_mux_list = gn_gnss_irq2_grp0_pad_mux,
  1879. };
  1880. static struct atlas7_pad_mux gn_gnss_tm_grp_pad_mux[] = {
  1881. MUX(1, 115, 4, N, N, N, N),
  1882. };
  1883. static struct atlas7_grp_mux gn_gnss_tm_grp_mux = {
  1884. .pad_mux_count = ARRAY_SIZE(gn_gnss_tm_grp_pad_mux),
  1885. .pad_mux_list = gn_gnss_tm_grp_pad_mux,
  1886. };
  1887. static struct atlas7_pad_mux gn_gnss_tsync_grp_pad_mux[] = {
  1888. MUX(1, 114, 4, N, N, N, N),
  1889. };
  1890. static struct atlas7_grp_mux gn_gnss_tsync_grp_mux = {
  1891. .pad_mux_count = ARRAY_SIZE(gn_gnss_tsync_grp_pad_mux),
  1892. .pad_mux_list = gn_gnss_tsync_grp_pad_mux,
  1893. };
  1894. static struct atlas7_pad_mux gn_io_gnsssys_sw_cfg_grp_pad_mux[] = {
  1895. MUX(1, 44, 7, N, N, N, N),
  1896. MUX(1, 43, 7, N, N, N, N),
  1897. MUX(1, 42, 7, N, N, N, N),
  1898. MUX(1, 41, 7, N, N, N, N),
  1899. MUX(1, 40, 7, N, N, N, N),
  1900. MUX(1, 39, 7, N, N, N, N),
  1901. MUX(1, 38, 7, N, N, N, N),
  1902. MUX(1, 37, 7, N, N, N, N),
  1903. MUX(1, 49, 7, N, N, N, N),
  1904. MUX(1, 50, 7, N, N, N, N),
  1905. MUX(1, 91, 7, N, N, N, N),
  1906. MUX(1, 92, 7, N, N, N, N),
  1907. MUX(1, 93, 7, N, N, N, N),
  1908. MUX(1, 94, 7, N, N, N, N),
  1909. MUX(1, 95, 7, N, N, N, N),
  1910. MUX(1, 96, 7, N, N, N, N),
  1911. };
  1912. static struct atlas7_grp_mux gn_io_gnsssys_sw_cfg_grp_mux = {
  1913. .pad_mux_count = ARRAY_SIZE(gn_io_gnsssys_sw_cfg_grp_pad_mux),
  1914. .pad_mux_list = gn_io_gnsssys_sw_cfg_grp_pad_mux,
  1915. };
  1916. static struct atlas7_pad_mux gn_trg_grp0_pad_mux[] = {
  1917. MUX(1, 29, 1, 0xa00, 6, 0xa80, 6),
  1918. MUX(1, 28, 1, 0xa00, 7, 0xa80, 7),
  1919. MUX(1, 26, 1, 0xa00, 8, 0xa80, 8),
  1920. MUX(1, 27, 1, 0xa00, 9, 0xa80, 9),
  1921. };
  1922. static struct atlas7_grp_mux gn_trg_grp0_mux = {
  1923. .pad_mux_count = ARRAY_SIZE(gn_trg_grp0_pad_mux),
  1924. .pad_mux_list = gn_trg_grp0_pad_mux,
  1925. };
  1926. static struct atlas7_pad_mux gn_trg_grp1_pad_mux[] = {
  1927. MUX(1, 77, 3, 0xa00, 6, 0xa80, 6),
  1928. MUX(1, 76, 3, 0xa00, 7, 0xa80, 7),
  1929. MUX(1, 74, 3, 0xa00, 8, 0xa80, 8),
  1930. MUX(1, 75, 3, 0xa00, 9, 0xa80, 9),
  1931. };
  1932. static struct atlas7_grp_mux gn_trg_grp1_mux = {
  1933. .pad_mux_count = ARRAY_SIZE(gn_trg_grp1_pad_mux),
  1934. .pad_mux_list = gn_trg_grp1_pad_mux,
  1935. };
  1936. static struct atlas7_pad_mux gn_trg_shutdown_grp0_pad_mux[] = {
  1937. MUX(1, 30, 1, N, N, N, N),
  1938. };
  1939. static struct atlas7_grp_mux gn_trg_shutdown_grp0_mux = {
  1940. .pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp0_pad_mux),
  1941. .pad_mux_list = gn_trg_shutdown_grp0_pad_mux,
  1942. };
  1943. static struct atlas7_pad_mux gn_trg_shutdown_grp1_pad_mux[] = {
  1944. MUX(1, 83, 3, N, N, N, N),
  1945. };
  1946. static struct atlas7_grp_mux gn_trg_shutdown_grp1_mux = {
  1947. .pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp1_pad_mux),
  1948. .pad_mux_list = gn_trg_shutdown_grp1_pad_mux,
  1949. };
  1950. static struct atlas7_pad_mux gn_trg_shutdown_grp2_pad_mux[] = {
  1951. MUX(1, 117, 4, N, N, N, N),
  1952. };
  1953. static struct atlas7_grp_mux gn_trg_shutdown_grp2_mux = {
  1954. .pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp2_pad_mux),
  1955. .pad_mux_list = gn_trg_shutdown_grp2_pad_mux,
  1956. };
  1957. static struct atlas7_pad_mux gn_trg_shutdown_grp3_pad_mux[] = {
  1958. MUX(1, 123, 5, N, N, N, N),
  1959. };
  1960. static struct atlas7_grp_mux gn_trg_shutdown_grp3_mux = {
  1961. .pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp3_pad_mux),
  1962. .pad_mux_list = gn_trg_shutdown_grp3_pad_mux,
  1963. };
  1964. static struct atlas7_pad_mux i2c0_grp_pad_mux[] = {
  1965. MUX(1, 128, 1, N, N, N, N),
  1966. MUX(1, 127, 1, N, N, N, N),
  1967. };
  1968. static struct atlas7_grp_mux i2c0_grp_mux = {
  1969. .pad_mux_count = ARRAY_SIZE(i2c0_grp_pad_mux),
  1970. .pad_mux_list = i2c0_grp_pad_mux,
  1971. };
  1972. static struct atlas7_pad_mux i2c1_grp_pad_mux[] = {
  1973. MUX(1, 126, 4, N, N, N, N),
  1974. MUX(1, 125, 4, N, N, N, N),
  1975. };
  1976. static struct atlas7_grp_mux i2c1_grp_mux = {
  1977. .pad_mux_count = ARRAY_SIZE(i2c1_grp_pad_mux),
  1978. .pad_mux_list = i2c1_grp_pad_mux,
  1979. };
  1980. static struct atlas7_pad_mux jtag_grp0_pad_mux[] = {
  1981. MUX(1, 125, 5, 0xa08, 2, 0xa88, 2),
  1982. MUX(0, 4, 3, 0xa08, 3, 0xa88, 3),
  1983. MUX(0, 2, 3, N, N, N, N),
  1984. MUX(0, 0, 3, N, N, N, N),
  1985. MUX(0, 1, 3, N, N, N, N),
  1986. MUX(0, 3, 3, N, N, N, N),
  1987. };
  1988. static struct atlas7_grp_mux jtag_grp0_mux = {
  1989. .pad_mux_count = ARRAY_SIZE(jtag_grp0_pad_mux),
  1990. .pad_mux_list = jtag_grp0_pad_mux,
  1991. };
  1992. static struct atlas7_pad_mux ks_kas_spi_grp0_pad_mux[] = {
  1993. MUX(1, 141, 2, N, N, N, N),
  1994. MUX(1, 144, 2, 0xa08, 8, 0xa88, 8),
  1995. MUX(1, 143, 2, N, N, N, N),
  1996. MUX(1, 142, 2, N, N, N, N),
  1997. };
  1998. static struct atlas7_grp_mux ks_kas_spi_grp0_mux = {
  1999. .pad_mux_count = ARRAY_SIZE(ks_kas_spi_grp0_pad_mux),
  2000. .pad_mux_list = ks_kas_spi_grp0_pad_mux,
  2001. };
  2002. static struct atlas7_pad_mux ld_ldd_grp_pad_mux[] = {
  2003. MUX(1, 57, 1, N, N, N, N),
  2004. MUX(1, 58, 1, N, N, N, N),
  2005. MUX(1, 59, 1, N, N, N, N),
  2006. MUX(1, 60, 1, N, N, N, N),
  2007. MUX(1, 61, 1, N, N, N, N),
  2008. MUX(1, 62, 1, N, N, N, N),
  2009. MUX(1, 63, 1, N, N, N, N),
  2010. MUX(1, 64, 1, N, N, N, N),
  2011. MUX(1, 65, 1, N, N, N, N),
  2012. MUX(1, 66, 1, N, N, N, N),
  2013. MUX(1, 67, 1, N, N, N, N),
  2014. MUX(1, 68, 1, N, N, N, N),
  2015. MUX(1, 69, 1, N, N, N, N),
  2016. MUX(1, 70, 1, N, N, N, N),
  2017. MUX(1, 71, 1, N, N, N, N),
  2018. MUX(1, 72, 1, N, N, N, N),
  2019. MUX(1, 74, 2, N, N, N, N),
  2020. MUX(1, 75, 2, N, N, N, N),
  2021. MUX(1, 76, 2, N, N, N, N),
  2022. MUX(1, 77, 2, N, N, N, N),
  2023. MUX(1, 78, 2, N, N, N, N),
  2024. MUX(1, 79, 2, N, N, N, N),
  2025. MUX(1, 80, 2, N, N, N, N),
  2026. MUX(1, 81, 2, N, N, N, N),
  2027. MUX(1, 56, 1, N, N, N, N),
  2028. MUX(1, 53, 1, N, N, N, N),
  2029. };
  2030. static struct atlas7_grp_mux ld_ldd_grp_mux = {
  2031. .pad_mux_count = ARRAY_SIZE(ld_ldd_grp_pad_mux),
  2032. .pad_mux_list = ld_ldd_grp_pad_mux,
  2033. };
  2034. static struct atlas7_pad_mux ld_ldd_16bit_grp_pad_mux[] = {
  2035. MUX(1, 57, 1, N, N, N, N),
  2036. MUX(1, 58, 1, N, N, N, N),
  2037. MUX(1, 59, 1, N, N, N, N),
  2038. MUX(1, 60, 1, N, N, N, N),
  2039. MUX(1, 61, 1, N, N, N, N),
  2040. MUX(1, 62, 1, N, N, N, N),
  2041. MUX(1, 63, 1, N, N, N, N),
  2042. MUX(1, 64, 1, N, N, N, N),
  2043. MUX(1, 65, 1, N, N, N, N),
  2044. MUX(1, 66, 1, N, N, N, N),
  2045. MUX(1, 67, 1, N, N, N, N),
  2046. MUX(1, 68, 1, N, N, N, N),
  2047. MUX(1, 69, 1, N, N, N, N),
  2048. MUX(1, 70, 1, N, N, N, N),
  2049. MUX(1, 71, 1, N, N, N, N),
  2050. MUX(1, 72, 1, N, N, N, N),
  2051. MUX(1, 56, 1, N, N, N, N),
  2052. MUX(1, 53, 1, N, N, N, N),
  2053. };
  2054. static struct atlas7_grp_mux ld_ldd_16bit_grp_mux = {
  2055. .pad_mux_count = ARRAY_SIZE(ld_ldd_16bit_grp_pad_mux),
  2056. .pad_mux_list = ld_ldd_16bit_grp_pad_mux,
  2057. };
  2058. static struct atlas7_pad_mux ld_ldd_fck_grp_pad_mux[] = {
  2059. MUX(1, 55, 1, N, N, N, N),
  2060. };
  2061. static struct atlas7_grp_mux ld_ldd_fck_grp_mux = {
  2062. .pad_mux_count = ARRAY_SIZE(ld_ldd_fck_grp_pad_mux),
  2063. .pad_mux_list = ld_ldd_fck_grp_pad_mux,
  2064. };
  2065. static struct atlas7_pad_mux ld_ldd_lck_grp_pad_mux[] = {
  2066. MUX(1, 54, 1, N, N, N, N),
  2067. };
  2068. static struct atlas7_grp_mux ld_ldd_lck_grp_mux = {
  2069. .pad_mux_count = ARRAY_SIZE(ld_ldd_lck_grp_pad_mux),
  2070. .pad_mux_list = ld_ldd_lck_grp_pad_mux,
  2071. };
  2072. static struct atlas7_pad_mux lr_lcdrom_grp_pad_mux[] = {
  2073. MUX(1, 73, 2, N, N, N, N),
  2074. MUX(1, 54, 2, N, N, N, N),
  2075. MUX(1, 57, 2, N, N, N, N),
  2076. MUX(1, 58, 2, N, N, N, N),
  2077. MUX(1, 59, 2, N, N, N, N),
  2078. MUX(1, 60, 2, N, N, N, N),
  2079. MUX(1, 61, 2, N, N, N, N),
  2080. MUX(1, 62, 2, N, N, N, N),
  2081. MUX(1, 63, 2, N, N, N, N),
  2082. MUX(1, 64, 2, N, N, N, N),
  2083. MUX(1, 65, 2, N, N, N, N),
  2084. MUX(1, 66, 2, N, N, N, N),
  2085. MUX(1, 67, 2, N, N, N, N),
  2086. MUX(1, 68, 2, N, N, N, N),
  2087. MUX(1, 69, 2, N, N, N, N),
  2088. MUX(1, 70, 2, N, N, N, N),
  2089. MUX(1, 71, 2, N, N, N, N),
  2090. MUX(1, 72, 2, N, N, N, N),
  2091. MUX(1, 56, 2, N, N, N, N),
  2092. MUX(1, 53, 2, N, N, N, N),
  2093. MUX(1, 55, 2, N, N, N, N),
  2094. };
  2095. static struct atlas7_grp_mux lr_lcdrom_grp_mux = {
  2096. .pad_mux_count = ARRAY_SIZE(lr_lcdrom_grp_pad_mux),
  2097. .pad_mux_list = lr_lcdrom_grp_pad_mux,
  2098. };
  2099. static struct atlas7_pad_mux lvds_analog_grp_pad_mux[] = {
  2100. MUX(1, 149, 8, N, N, N, N),
  2101. MUX(1, 150, 8, N, N, N, N),
  2102. MUX(1, 151, 8, N, N, N, N),
  2103. MUX(1, 152, 8, N, N, N, N),
  2104. MUX(1, 153, 8, N, N, N, N),
  2105. MUX(1, 154, 8, N, N, N, N),
  2106. MUX(1, 155, 8, N, N, N, N),
  2107. MUX(1, 156, 8, N, N, N, N),
  2108. MUX(1, 157, 8, N, N, N, N),
  2109. MUX(1, 158, 8, N, N, N, N),
  2110. };
  2111. static struct atlas7_grp_mux lvds_analog_grp_mux = {
  2112. .pad_mux_count = ARRAY_SIZE(lvds_analog_grp_pad_mux),
  2113. .pad_mux_list = lvds_analog_grp_pad_mux,
  2114. };
  2115. static struct atlas7_pad_mux nd_df_grp_pad_mux[] = {
  2116. MUX(1, 44, 1, N, N, N, N),
  2117. MUX(1, 43, 1, N, N, N, N),
  2118. MUX(1, 42, 1, N, N, N, N),
  2119. MUX(1, 41, 1, N, N, N, N),
  2120. MUX(1, 40, 1, N, N, N, N),
  2121. MUX(1, 39, 1, N, N, N, N),
  2122. MUX(1, 38, 1, N, N, N, N),
  2123. MUX(1, 37, 1, N, N, N, N),
  2124. MUX(1, 47, 1, N, N, N, N),
  2125. MUX(1, 46, 1, N, N, N, N),
  2126. MUX(1, 52, 1, N, N, N, N),
  2127. MUX(1, 51, 1, N, N, N, N),
  2128. MUX(1, 45, 1, N, N, N, N),
  2129. MUX(1, 49, 1, N, N, N, N),
  2130. MUX(1, 50, 1, N, N, N, N),
  2131. MUX(1, 48, 1, N, N, N, N),
  2132. MUX(1, 124, 4, N, N, N, N),
  2133. };
  2134. static struct atlas7_grp_mux nd_df_grp_mux = {
  2135. .pad_mux_count = ARRAY_SIZE(nd_df_grp_pad_mux),
  2136. .pad_mux_list = nd_df_grp_pad_mux,
  2137. };
  2138. static struct atlas7_pad_mux nd_df_nowp_grp_pad_mux[] = {
  2139. MUX(1, 44, 1, N, N, N, N),
  2140. MUX(1, 43, 1, N, N, N, N),
  2141. MUX(1, 42, 1, N, N, N, N),
  2142. MUX(1, 41, 1, N, N, N, N),
  2143. MUX(1, 40, 1, N, N, N, N),
  2144. MUX(1, 39, 1, N, N, N, N),
  2145. MUX(1, 38, 1, N, N, N, N),
  2146. MUX(1, 37, 1, N, N, N, N),
  2147. MUX(1, 47, 1, N, N, N, N),
  2148. MUX(1, 46, 1, N, N, N, N),
  2149. MUX(1, 52, 1, N, N, N, N),
  2150. MUX(1, 51, 1, N, N, N, N),
  2151. MUX(1, 45, 1, N, N, N, N),
  2152. MUX(1, 49, 1, N, N, N, N),
  2153. MUX(1, 50, 1, N, N, N, N),
  2154. MUX(1, 48, 1, N, N, N, N),
  2155. };
  2156. static struct atlas7_grp_mux nd_df_nowp_grp_mux = {
  2157. .pad_mux_count = ARRAY_SIZE(nd_df_nowp_grp_pad_mux),
  2158. .pad_mux_list = nd_df_nowp_grp_pad_mux,
  2159. };
  2160. static struct atlas7_pad_mux ps_grp_pad_mux[] = {
  2161. MUX(1, 120, 2, N, N, N, N),
  2162. MUX(1, 119, 2, N, N, N, N),
  2163. };
  2164. static struct atlas7_grp_mux ps_grp_mux = {
  2165. .pad_mux_count = ARRAY_SIZE(ps_grp_pad_mux),
  2166. .pad_mux_list = ps_grp_pad_mux,
  2167. };
  2168. static struct atlas7_pad_mux pwc_core_on_grp_pad_mux[] = {
  2169. MUX(0, 8, 1, N, N, N, N),
  2170. };
  2171. static struct atlas7_grp_mux pwc_core_on_grp_mux = {
  2172. .pad_mux_count = ARRAY_SIZE(pwc_core_on_grp_pad_mux),
  2173. .pad_mux_list = pwc_core_on_grp_pad_mux,
  2174. };
  2175. static struct atlas7_pad_mux pwc_ext_on_grp_pad_mux[] = {
  2176. MUX(0, 6, 1, N, N, N, N),
  2177. };
  2178. static struct atlas7_grp_mux pwc_ext_on_grp_mux = {
  2179. .pad_mux_count = ARRAY_SIZE(pwc_ext_on_grp_pad_mux),
  2180. .pad_mux_list = pwc_ext_on_grp_pad_mux,
  2181. };
  2182. static struct atlas7_pad_mux pwc_gpio3_clk_grp_pad_mux[] = {
  2183. MUX(0, 3, 4, N, N, N, N),
  2184. };
  2185. static struct atlas7_grp_mux pwc_gpio3_clk_grp_mux = {
  2186. .pad_mux_count = ARRAY_SIZE(pwc_gpio3_clk_grp_pad_mux),
  2187. .pad_mux_list = pwc_gpio3_clk_grp_pad_mux,
  2188. };
  2189. static struct atlas7_pad_mux pwc_io_on_grp_pad_mux[] = {
  2190. MUX(0, 9, 1, N, N, N, N),
  2191. };
  2192. static struct atlas7_grp_mux pwc_io_on_grp_mux = {
  2193. .pad_mux_count = ARRAY_SIZE(pwc_io_on_grp_pad_mux),
  2194. .pad_mux_list = pwc_io_on_grp_pad_mux,
  2195. };
  2196. static struct atlas7_pad_mux pwc_lowbatt_b_grp0_pad_mux[] = {
  2197. MUX(0, 4, 1, 0xa08, 4, 0xa88, 4),
  2198. };
  2199. static struct atlas7_grp_mux pwc_lowbatt_b_grp0_mux = {
  2200. .pad_mux_count = ARRAY_SIZE(pwc_lowbatt_b_grp0_pad_mux),
  2201. .pad_mux_list = pwc_lowbatt_b_grp0_pad_mux,
  2202. };
  2203. static struct atlas7_pad_mux pwc_mem_on_grp_pad_mux[] = {
  2204. MUX(0, 7, 1, N, N, N, N),
  2205. };
  2206. static struct atlas7_grp_mux pwc_mem_on_grp_mux = {
  2207. .pad_mux_count = ARRAY_SIZE(pwc_mem_on_grp_pad_mux),
  2208. .pad_mux_list = pwc_mem_on_grp_pad_mux,
  2209. };
  2210. static struct atlas7_pad_mux pwc_on_key_b_grp0_pad_mux[] = {
  2211. MUX(0, 5, 1, 0xa08, 5, 0xa88, 5),
  2212. };
  2213. static struct atlas7_grp_mux pwc_on_key_b_grp0_mux = {
  2214. .pad_mux_count = ARRAY_SIZE(pwc_on_key_b_grp0_pad_mux),
  2215. .pad_mux_list = pwc_on_key_b_grp0_pad_mux,
  2216. };
  2217. static struct atlas7_pad_mux pwc_wakeup_src0_grp_pad_mux[] = {
  2218. MUX(0, 0, 1, N, N, N, N),
  2219. };
  2220. static struct atlas7_grp_mux pwc_wakeup_src0_grp_mux = {
  2221. .pad_mux_count = ARRAY_SIZE(pwc_wakeup_src0_grp_pad_mux),
  2222. .pad_mux_list = pwc_wakeup_src0_grp_pad_mux,
  2223. };
  2224. static struct atlas7_pad_mux pwc_wakeup_src1_grp_pad_mux[] = {
  2225. MUX(0, 1, 1, N, N, N, N),
  2226. };
  2227. static struct atlas7_grp_mux pwc_wakeup_src1_grp_mux = {
  2228. .pad_mux_count = ARRAY_SIZE(pwc_wakeup_src1_grp_pad_mux),
  2229. .pad_mux_list = pwc_wakeup_src1_grp_pad_mux,
  2230. };
  2231. static struct atlas7_pad_mux pwc_wakeup_src2_grp_pad_mux[] = {
  2232. MUX(0, 2, 1, N, N, N, N),
  2233. };
  2234. static struct atlas7_grp_mux pwc_wakeup_src2_grp_mux = {
  2235. .pad_mux_count = ARRAY_SIZE(pwc_wakeup_src2_grp_pad_mux),
  2236. .pad_mux_list = pwc_wakeup_src2_grp_pad_mux,
  2237. };
  2238. static struct atlas7_pad_mux pwc_wakeup_src3_grp_pad_mux[] = {
  2239. MUX(0, 3, 1, N, N, N, N),
  2240. };
  2241. static struct atlas7_grp_mux pwc_wakeup_src3_grp_mux = {
  2242. .pad_mux_count = ARRAY_SIZE(pwc_wakeup_src3_grp_pad_mux),
  2243. .pad_mux_list = pwc_wakeup_src3_grp_pad_mux,
  2244. };
  2245. static struct atlas7_pad_mux pw_cko0_grp0_pad_mux[] = {
  2246. MUX(1, 123, 3, N, N, N, N),
  2247. };
  2248. static struct atlas7_grp_mux pw_cko0_grp0_mux = {
  2249. .pad_mux_count = ARRAY_SIZE(pw_cko0_grp0_pad_mux),
  2250. .pad_mux_list = pw_cko0_grp0_pad_mux,
  2251. };
  2252. static struct atlas7_pad_mux pw_cko0_grp1_pad_mux[] = {
  2253. MUX(1, 101, 4, N, N, N, N),
  2254. };
  2255. static struct atlas7_grp_mux pw_cko0_grp1_mux = {
  2256. .pad_mux_count = ARRAY_SIZE(pw_cko0_grp1_pad_mux),
  2257. .pad_mux_list = pw_cko0_grp1_pad_mux,
  2258. };
  2259. static struct atlas7_pad_mux pw_cko0_grp2_pad_mux[] = {
  2260. MUX(1, 82, 2, N, N, N, N),
  2261. };
  2262. static struct atlas7_grp_mux pw_cko0_grp2_mux = {
  2263. .pad_mux_count = ARRAY_SIZE(pw_cko0_grp2_pad_mux),
  2264. .pad_mux_list = pw_cko0_grp2_pad_mux,
  2265. };
  2266. static struct atlas7_pad_mux pw_cko1_grp0_pad_mux[] = {
  2267. MUX(1, 124, 3, N, N, N, N),
  2268. };
  2269. static struct atlas7_grp_mux pw_cko1_grp0_mux = {
  2270. .pad_mux_count = ARRAY_SIZE(pw_cko1_grp0_pad_mux),
  2271. .pad_mux_list = pw_cko1_grp0_pad_mux,
  2272. };
  2273. static struct atlas7_pad_mux pw_cko1_grp1_pad_mux[] = {
  2274. MUX(1, 110, 4, N, N, N, N),
  2275. };
  2276. static struct atlas7_grp_mux pw_cko1_grp1_mux = {
  2277. .pad_mux_count = ARRAY_SIZE(pw_cko1_grp1_pad_mux),
  2278. .pad_mux_list = pw_cko1_grp1_pad_mux,
  2279. };
  2280. static struct atlas7_pad_mux pw_i2s01_clk_grp0_pad_mux[] = {
  2281. MUX(1, 125, 3, N, N, N, N),
  2282. };
  2283. static struct atlas7_grp_mux pw_i2s01_clk_grp0_mux = {
  2284. .pad_mux_count = ARRAY_SIZE(pw_i2s01_clk_grp0_pad_mux),
  2285. .pad_mux_list = pw_i2s01_clk_grp0_pad_mux,
  2286. };
  2287. static struct atlas7_pad_mux pw_i2s01_clk_grp1_pad_mux[] = {
  2288. MUX(1, 117, 3, N, N, N, N),
  2289. };
  2290. static struct atlas7_grp_mux pw_i2s01_clk_grp1_mux = {
  2291. .pad_mux_count = ARRAY_SIZE(pw_i2s01_clk_grp1_pad_mux),
  2292. .pad_mux_list = pw_i2s01_clk_grp1_pad_mux,
  2293. };
  2294. static struct atlas7_pad_mux pw_pwm0_grp_pad_mux[] = {
  2295. MUX(1, 119, 3, N, N, N, N),
  2296. };
  2297. static struct atlas7_grp_mux pw_pwm0_grp_mux = {
  2298. .pad_mux_count = ARRAY_SIZE(pw_pwm0_grp_pad_mux),
  2299. .pad_mux_list = pw_pwm0_grp_pad_mux,
  2300. };
  2301. static struct atlas7_pad_mux pw_pwm1_grp_pad_mux[] = {
  2302. MUX(1, 120, 3, N, N, N, N),
  2303. };
  2304. static struct atlas7_grp_mux pw_pwm1_grp_mux = {
  2305. .pad_mux_count = ARRAY_SIZE(pw_pwm1_grp_pad_mux),
  2306. .pad_mux_list = pw_pwm1_grp_pad_mux,
  2307. };
  2308. static struct atlas7_pad_mux pw_pwm2_grp0_pad_mux[] = {
  2309. MUX(1, 121, 3, N, N, N, N),
  2310. };
  2311. static struct atlas7_grp_mux pw_pwm2_grp0_mux = {
  2312. .pad_mux_count = ARRAY_SIZE(pw_pwm2_grp0_pad_mux),
  2313. .pad_mux_list = pw_pwm2_grp0_pad_mux,
  2314. };
  2315. static struct atlas7_pad_mux pw_pwm2_grp1_pad_mux[] = {
  2316. MUX(1, 98, 3, N, N, N, N),
  2317. };
  2318. static struct atlas7_grp_mux pw_pwm2_grp1_mux = {
  2319. .pad_mux_count = ARRAY_SIZE(pw_pwm2_grp1_pad_mux),
  2320. .pad_mux_list = pw_pwm2_grp1_pad_mux,
  2321. };
  2322. static struct atlas7_pad_mux pw_pwm3_grp0_pad_mux[] = {
  2323. MUX(1, 122, 3, N, N, N, N),
  2324. };
  2325. static struct atlas7_grp_mux pw_pwm3_grp0_mux = {
  2326. .pad_mux_count = ARRAY_SIZE(pw_pwm3_grp0_pad_mux),
  2327. .pad_mux_list = pw_pwm3_grp0_pad_mux,
  2328. };
  2329. static struct atlas7_pad_mux pw_pwm3_grp1_pad_mux[] = {
  2330. MUX(1, 73, 4, N, N, N, N),
  2331. };
  2332. static struct atlas7_grp_mux pw_pwm3_grp1_mux = {
  2333. .pad_mux_count = ARRAY_SIZE(pw_pwm3_grp1_pad_mux),
  2334. .pad_mux_list = pw_pwm3_grp1_pad_mux,
  2335. };
  2336. static struct atlas7_pad_mux pw_pwm_cpu_vol_grp0_pad_mux[] = {
  2337. MUX(1, 121, 3, N, N, N, N),
  2338. };
  2339. static struct atlas7_grp_mux pw_pwm_cpu_vol_grp0_mux = {
  2340. .pad_mux_count = ARRAY_SIZE(pw_pwm_cpu_vol_grp0_pad_mux),
  2341. .pad_mux_list = pw_pwm_cpu_vol_grp0_pad_mux,
  2342. };
  2343. static struct atlas7_pad_mux pw_pwm_cpu_vol_grp1_pad_mux[] = {
  2344. MUX(1, 98, 3, N, N, N, N),
  2345. };
  2346. static struct atlas7_grp_mux pw_pwm_cpu_vol_grp1_mux = {
  2347. .pad_mux_count = ARRAY_SIZE(pw_pwm_cpu_vol_grp1_pad_mux),
  2348. .pad_mux_list = pw_pwm_cpu_vol_grp1_pad_mux,
  2349. };
  2350. static struct atlas7_pad_mux pw_backlight_grp0_pad_mux[] = {
  2351. MUX(1, 122, 3, N, N, N, N),
  2352. };
  2353. static struct atlas7_grp_mux pw_backlight_grp0_mux = {
  2354. .pad_mux_count = ARRAY_SIZE(pw_backlight_grp0_pad_mux),
  2355. .pad_mux_list = pw_backlight_grp0_pad_mux,
  2356. };
  2357. static struct atlas7_pad_mux pw_backlight_grp1_pad_mux[] = {
  2358. MUX(1, 73, 4, N, N, N, N),
  2359. };
  2360. static struct atlas7_grp_mux pw_backlight_grp1_mux = {
  2361. .pad_mux_count = ARRAY_SIZE(pw_backlight_grp1_pad_mux),
  2362. .pad_mux_list = pw_backlight_grp1_pad_mux,
  2363. };
  2364. static struct atlas7_pad_mux rg_eth_mac_grp_pad_mux[] = {
  2365. MUX(1, 108, 1, N, N, N, N),
  2366. MUX(1, 103, 1, N, N, N, N),
  2367. MUX(1, 104, 1, N, N, N, N),
  2368. MUX(1, 105, 1, N, N, N, N),
  2369. MUX(1, 106, 1, N, N, N, N),
  2370. MUX(1, 107, 1, N, N, N, N),
  2371. MUX(1, 102, 1, N, N, N, N),
  2372. MUX(1, 97, 1, N, N, N, N),
  2373. MUX(1, 98, 1, N, N, N, N),
  2374. MUX(1, 99, 1, N, N, N, N),
  2375. MUX(1, 100, 1, N, N, N, N),
  2376. MUX(1, 101, 1, N, N, N, N),
  2377. };
  2378. static struct atlas7_grp_mux rg_eth_mac_grp_mux = {
  2379. .pad_mux_count = ARRAY_SIZE(rg_eth_mac_grp_pad_mux),
  2380. .pad_mux_list = rg_eth_mac_grp_pad_mux,
  2381. };
  2382. static struct atlas7_pad_mux rg_gmac_phy_intr_n_grp_pad_mux[] = {
  2383. MUX(1, 111, 1, 0xa08, 13, 0xa88, 13),
  2384. };
  2385. static struct atlas7_grp_mux rg_gmac_phy_intr_n_grp_mux = {
  2386. .pad_mux_count = ARRAY_SIZE(rg_gmac_phy_intr_n_grp_pad_mux),
  2387. .pad_mux_list = rg_gmac_phy_intr_n_grp_pad_mux,
  2388. };
  2389. static struct atlas7_pad_mux rg_rgmii_mac_grp_pad_mux[] = {
  2390. MUX(1, 109, 1, N, N, N, N),
  2391. MUX(1, 110, 1, N, N, N, N),
  2392. };
  2393. static struct atlas7_grp_mux rg_rgmii_mac_grp_mux = {
  2394. .pad_mux_count = ARRAY_SIZE(rg_rgmii_mac_grp_pad_mux),
  2395. .pad_mux_list = rg_rgmii_mac_grp_pad_mux,
  2396. };
  2397. static struct atlas7_pad_mux rg_rgmii_phy_ref_clk_grp0_pad_mux[] = {
  2398. MUX(1, 111, 5, N, N, N, N),
  2399. };
  2400. static struct atlas7_grp_mux rg_rgmii_phy_ref_clk_grp0_mux = {
  2401. .pad_mux_count = ARRAY_SIZE(rg_rgmii_phy_ref_clk_grp0_pad_mux),
  2402. .pad_mux_list = rg_rgmii_phy_ref_clk_grp0_pad_mux,
  2403. };
  2404. static struct atlas7_pad_mux rg_rgmii_phy_ref_clk_grp1_pad_mux[] = {
  2405. MUX(1, 53, 4, N, N, N, N),
  2406. };
  2407. static struct atlas7_grp_mux rg_rgmii_phy_ref_clk_grp1_mux = {
  2408. .pad_mux_count = ARRAY_SIZE(rg_rgmii_phy_ref_clk_grp1_pad_mux),
  2409. .pad_mux_list = rg_rgmii_phy_ref_clk_grp1_pad_mux,
  2410. };
  2411. static struct atlas7_pad_mux sd0_grp_pad_mux[] = {
  2412. MUX(1, 46, 2, N, N, N, N),
  2413. MUX(1, 47, 2, N, N, N, N),
  2414. MUX(1, 44, 2, N, N, N, N),
  2415. MUX(1, 43, 2, N, N, N, N),
  2416. MUX(1, 42, 2, N, N, N, N),
  2417. MUX(1, 41, 2, N, N, N, N),
  2418. MUX(1, 40, 2, N, N, N, N),
  2419. MUX(1, 39, 2, N, N, N, N),
  2420. MUX(1, 38, 2, N, N, N, N),
  2421. MUX(1, 37, 2, N, N, N, N),
  2422. };
  2423. static struct atlas7_grp_mux sd0_grp_mux = {
  2424. .pad_mux_count = ARRAY_SIZE(sd0_grp_pad_mux),
  2425. .pad_mux_list = sd0_grp_pad_mux,
  2426. };
  2427. static struct atlas7_pad_mux sd0_4bit_grp_pad_mux[] = {
  2428. MUX(1, 46, 2, N, N, N, N),
  2429. MUX(1, 47, 2, N, N, N, N),
  2430. MUX(1, 44, 2, N, N, N, N),
  2431. MUX(1, 43, 2, N, N, N, N),
  2432. MUX(1, 42, 2, N, N, N, N),
  2433. MUX(1, 41, 2, N, N, N, N),
  2434. };
  2435. static struct atlas7_grp_mux sd0_4bit_grp_mux = {
  2436. .pad_mux_count = ARRAY_SIZE(sd0_4bit_grp_pad_mux),
  2437. .pad_mux_list = sd0_4bit_grp_pad_mux,
  2438. };
  2439. static struct atlas7_pad_mux sd1_grp_pad_mux[] = {
  2440. MUX(1, 48, 3, N, N, N, N),
  2441. MUX(1, 49, 3, N, N, N, N),
  2442. MUX(1, 44, 3, 0xa00, 0, 0xa80, 0),
  2443. MUX(1, 43, 3, 0xa00, 1, 0xa80, 1),
  2444. MUX(1, 42, 3, 0xa00, 2, 0xa80, 2),
  2445. MUX(1, 41, 3, 0xa00, 3, 0xa80, 3),
  2446. MUX(1, 40, 3, N, N, N, N),
  2447. MUX(1, 39, 3, N, N, N, N),
  2448. MUX(1, 38, 3, N, N, N, N),
  2449. MUX(1, 37, 3, N, N, N, N),
  2450. };
  2451. static struct atlas7_grp_mux sd1_grp_mux = {
  2452. .pad_mux_count = ARRAY_SIZE(sd1_grp_pad_mux),
  2453. .pad_mux_list = sd1_grp_pad_mux,
  2454. };
  2455. static struct atlas7_pad_mux sd1_4bit_grp0_pad_mux[] = {
  2456. MUX(1, 48, 3, N, N, N, N),
  2457. MUX(1, 49, 3, N, N, N, N),
  2458. MUX(1, 44, 3, 0xa00, 0, 0xa80, 0),
  2459. MUX(1, 43, 3, 0xa00, 1, 0xa80, 1),
  2460. MUX(1, 42, 3, 0xa00, 2, 0xa80, 2),
  2461. MUX(1, 41, 3, 0xa00, 3, 0xa80, 3),
  2462. };
  2463. static struct atlas7_grp_mux sd1_4bit_grp0_mux = {
  2464. .pad_mux_count = ARRAY_SIZE(sd1_4bit_grp0_pad_mux),
  2465. .pad_mux_list = sd1_4bit_grp0_pad_mux,
  2466. };
  2467. static struct atlas7_pad_mux sd1_4bit_grp1_pad_mux[] = {
  2468. MUX(1, 48, 3, N, N, N, N),
  2469. MUX(1, 49, 3, N, N, N, N),
  2470. MUX(1, 40, 4, 0xa00, 0, 0xa80, 0),
  2471. MUX(1, 39, 4, 0xa00, 1, 0xa80, 1),
  2472. MUX(1, 38, 4, 0xa00, 2, 0xa80, 2),
  2473. MUX(1, 37, 4, 0xa00, 3, 0xa80, 3),
  2474. };
  2475. static struct atlas7_grp_mux sd1_4bit_grp1_mux = {
  2476. .pad_mux_count = ARRAY_SIZE(sd1_4bit_grp1_pad_mux),
  2477. .pad_mux_list = sd1_4bit_grp1_pad_mux,
  2478. };
  2479. static struct atlas7_pad_mux sd2_grp0_pad_mux[] = {
  2480. MUX(1, 124, 2, 0xa08, 7, 0xa88, 7),
  2481. MUX(1, 31, 1, N, N, N, N),
  2482. MUX(1, 32, 1, N, N, N, N),
  2483. MUX(1, 33, 1, N, N, N, N),
  2484. MUX(1, 34, 1, N, N, N, N),
  2485. MUX(1, 35, 1, N, N, N, N),
  2486. MUX(1, 36, 1, N, N, N, N),
  2487. MUX(1, 123, 2, N, N, N, N),
  2488. };
  2489. static struct atlas7_grp_mux sd2_grp0_mux = {
  2490. .pad_mux_count = ARRAY_SIZE(sd2_grp0_pad_mux),
  2491. .pad_mux_list = sd2_grp0_pad_mux,
  2492. };
  2493. static struct atlas7_pad_mux sd2_no_cdb_grp0_pad_mux[] = {
  2494. MUX(1, 31, 1, N, N, N, N),
  2495. MUX(1, 32, 1, N, N, N, N),
  2496. MUX(1, 33, 1, N, N, N, N),
  2497. MUX(1, 34, 1, N, N, N, N),
  2498. MUX(1, 35, 1, N, N, N, N),
  2499. MUX(1, 36, 1, N, N, N, N),
  2500. MUX(1, 123, 2, N, N, N, N),
  2501. };
  2502. static struct atlas7_grp_mux sd2_no_cdb_grp0_mux = {
  2503. .pad_mux_count = ARRAY_SIZE(sd2_no_cdb_grp0_pad_mux),
  2504. .pad_mux_list = sd2_no_cdb_grp0_pad_mux,
  2505. };
  2506. static struct atlas7_pad_mux sd3_grp_pad_mux[] = {
  2507. MUX(1, 85, 1, N, N, N, N),
  2508. MUX(1, 86, 1, N, N, N, N),
  2509. MUX(1, 87, 1, N, N, N, N),
  2510. MUX(1, 88, 1, N, N, N, N),
  2511. MUX(1, 89, 1, N, N, N, N),
  2512. MUX(1, 90, 1, N, N, N, N),
  2513. };
  2514. static struct atlas7_grp_mux sd3_grp_mux = {
  2515. .pad_mux_count = ARRAY_SIZE(sd3_grp_pad_mux),
  2516. .pad_mux_list = sd3_grp_pad_mux,
  2517. };
  2518. static struct atlas7_pad_mux sd5_grp_pad_mux[] = {
  2519. MUX(1, 91, 1, N, N, N, N),
  2520. MUX(1, 92, 1, N, N, N, N),
  2521. MUX(1, 93, 1, N, N, N, N),
  2522. MUX(1, 94, 1, N, N, N, N),
  2523. MUX(1, 95, 1, N, N, N, N),
  2524. MUX(1, 96, 1, N, N, N, N),
  2525. };
  2526. static struct atlas7_grp_mux sd5_grp_mux = {
  2527. .pad_mux_count = ARRAY_SIZE(sd5_grp_pad_mux),
  2528. .pad_mux_list = sd5_grp_pad_mux,
  2529. };
  2530. static struct atlas7_pad_mux sd6_grp0_pad_mux[] = {
  2531. MUX(1, 79, 4, 0xa00, 27, 0xa80, 27),
  2532. MUX(1, 78, 4, 0xa00, 26, 0xa80, 26),
  2533. MUX(1, 74, 4, 0xa00, 28, 0xa80, 28),
  2534. MUX(1, 75, 4, 0xa00, 29, 0xa80, 29),
  2535. MUX(1, 76, 4, 0xa00, 30, 0xa80, 30),
  2536. MUX(1, 77, 4, 0xa00, 31, 0xa80, 31),
  2537. };
  2538. static struct atlas7_grp_mux sd6_grp0_mux = {
  2539. .pad_mux_count = ARRAY_SIZE(sd6_grp0_pad_mux),
  2540. .pad_mux_list = sd6_grp0_pad_mux,
  2541. };
  2542. static struct atlas7_pad_mux sd6_grp1_pad_mux[] = {
  2543. MUX(1, 101, 3, 0xa00, 27, 0xa80, 27),
  2544. MUX(1, 99, 3, 0xa00, 26, 0xa80, 26),
  2545. MUX(1, 100, 3, 0xa00, 28, 0xa80, 28),
  2546. MUX(1, 110, 3, 0xa00, 29, 0xa80, 29),
  2547. MUX(1, 109, 3, 0xa00, 30, 0xa80, 30),
  2548. MUX(1, 111, 3, 0xa00, 31, 0xa80, 31),
  2549. };
  2550. static struct atlas7_grp_mux sd6_grp1_mux = {
  2551. .pad_mux_count = ARRAY_SIZE(sd6_grp1_pad_mux),
  2552. .pad_mux_list = sd6_grp1_pad_mux,
  2553. };
  2554. static struct atlas7_pad_mux sp0_ext_ldo_on_grp_pad_mux[] = {
  2555. MUX(0, 4, 2, N, N, N, N),
  2556. };
  2557. static struct atlas7_grp_mux sp0_ext_ldo_on_grp_mux = {
  2558. .pad_mux_count = ARRAY_SIZE(sp0_ext_ldo_on_grp_pad_mux),
  2559. .pad_mux_list = sp0_ext_ldo_on_grp_pad_mux,
  2560. };
  2561. static struct atlas7_pad_mux sp0_qspi_grp_pad_mux[] = {
  2562. MUX(0, 12, 1, N, N, N, N),
  2563. MUX(0, 13, 1, N, N, N, N),
  2564. MUX(0, 14, 1, N, N, N, N),
  2565. MUX(0, 15, 1, N, N, N, N),
  2566. MUX(0, 16, 1, N, N, N, N),
  2567. MUX(0, 17, 1, N, N, N, N),
  2568. };
  2569. static struct atlas7_grp_mux sp0_qspi_grp_mux = {
  2570. .pad_mux_count = ARRAY_SIZE(sp0_qspi_grp_pad_mux),
  2571. .pad_mux_list = sp0_qspi_grp_pad_mux,
  2572. };
  2573. static struct atlas7_pad_mux sp1_spi_grp_pad_mux[] = {
  2574. MUX(1, 19, 1, N, N, N, N),
  2575. MUX(1, 20, 1, N, N, N, N),
  2576. MUX(1, 21, 1, N, N, N, N),
  2577. MUX(1, 18, 1, N, N, N, N),
  2578. };
  2579. static struct atlas7_grp_mux sp1_spi_grp_mux = {
  2580. .pad_mux_count = ARRAY_SIZE(sp1_spi_grp_pad_mux),
  2581. .pad_mux_list = sp1_spi_grp_pad_mux,
  2582. };
  2583. static struct atlas7_pad_mux tpiu_trace_grp_pad_mux[] = {
  2584. MUX(1, 53, 5, N, N, N, N),
  2585. MUX(1, 56, 5, N, N, N, N),
  2586. MUX(1, 57, 5, N, N, N, N),
  2587. MUX(1, 58, 5, N, N, N, N),
  2588. MUX(1, 59, 5, N, N, N, N),
  2589. MUX(1, 60, 5, N, N, N, N),
  2590. MUX(1, 61, 5, N, N, N, N),
  2591. MUX(1, 62, 5, N, N, N, N),
  2592. MUX(1, 63, 5, N, N, N, N),
  2593. MUX(1, 64, 5, N, N, N, N),
  2594. MUX(1, 65, 5, N, N, N, N),
  2595. MUX(1, 66, 5, N, N, N, N),
  2596. MUX(1, 67, 5, N, N, N, N),
  2597. MUX(1, 68, 5, N, N, N, N),
  2598. MUX(1, 69, 5, N, N, N, N),
  2599. MUX(1, 70, 5, N, N, N, N),
  2600. MUX(1, 71, 5, N, N, N, N),
  2601. MUX(1, 72, 5, N, N, N, N),
  2602. };
  2603. static struct atlas7_grp_mux tpiu_trace_grp_mux = {
  2604. .pad_mux_count = ARRAY_SIZE(tpiu_trace_grp_pad_mux),
  2605. .pad_mux_list = tpiu_trace_grp_pad_mux,
  2606. };
  2607. static struct atlas7_pad_mux uart0_grp_pad_mux[] = {
  2608. MUX(1, 121, 4, N, N, N, N),
  2609. MUX(1, 120, 4, N, N, N, N),
  2610. MUX(1, 134, 1, N, N, N, N),
  2611. MUX(1, 133, 1, N, N, N, N),
  2612. };
  2613. static struct atlas7_grp_mux uart0_grp_mux = {
  2614. .pad_mux_count = ARRAY_SIZE(uart0_grp_pad_mux),
  2615. .pad_mux_list = uart0_grp_pad_mux,
  2616. };
  2617. static struct atlas7_pad_mux uart0_nopause_grp_pad_mux[] = {
  2618. MUX(1, 134, 1, N, N, N, N),
  2619. MUX(1, 133, 1, N, N, N, N),
  2620. };
  2621. static struct atlas7_grp_mux uart0_nopause_grp_mux = {
  2622. .pad_mux_count = ARRAY_SIZE(uart0_nopause_grp_pad_mux),
  2623. .pad_mux_list = uart0_nopause_grp_pad_mux,
  2624. };
  2625. static struct atlas7_pad_mux uart1_grp_pad_mux[] = {
  2626. MUX(1, 136, 1, N, N, N, N),
  2627. MUX(1, 135, 1, N, N, N, N),
  2628. };
  2629. static struct atlas7_grp_mux uart1_grp_mux = {
  2630. .pad_mux_count = ARRAY_SIZE(uart1_grp_pad_mux),
  2631. .pad_mux_list = uart1_grp_pad_mux,
  2632. };
  2633. static struct atlas7_pad_mux uart2_grp_pad_mux[] = {
  2634. MUX(0, 11, 2, N, N, N, N),
  2635. MUX(0, 10, 2, N, N, N, N),
  2636. };
  2637. static struct atlas7_grp_mux uart2_grp_mux = {
  2638. .pad_mux_count = ARRAY_SIZE(uart2_grp_pad_mux),
  2639. .pad_mux_list = uart2_grp_pad_mux,
  2640. };
  2641. static struct atlas7_pad_mux uart3_grp0_pad_mux[] = {
  2642. MUX(1, 125, 2, 0xa08, 0, 0xa88, 0),
  2643. MUX(1, 126, 2, N, N, N, N),
  2644. MUX(1, 138, 1, 0xa00, 5, 0xa80, 5),
  2645. MUX(1, 137, 1, N, N, N, N),
  2646. };
  2647. static struct atlas7_grp_mux uart3_grp0_mux = {
  2648. .pad_mux_count = ARRAY_SIZE(uart3_grp0_pad_mux),
  2649. .pad_mux_list = uart3_grp0_pad_mux,
  2650. };
  2651. static struct atlas7_pad_mux uart3_grp1_pad_mux[] = {
  2652. MUX(1, 111, 4, 0xa08, 0, 0xa88, 0),
  2653. MUX(1, 109, 4, N, N, N, N),
  2654. MUX(1, 84, 2, 0xa00, 5, 0xa80, 5),
  2655. MUX(1, 83, 2, N, N, N, N),
  2656. };
  2657. static struct atlas7_grp_mux uart3_grp1_mux = {
  2658. .pad_mux_count = ARRAY_SIZE(uart3_grp1_pad_mux),
  2659. .pad_mux_list = uart3_grp1_pad_mux,
  2660. };
  2661. static struct atlas7_pad_mux uart3_grp2_pad_mux[] = {
  2662. MUX(1, 140, 2, 0xa08, 0, 0xa88, 0),
  2663. MUX(1, 139, 2, N, N, N, N),
  2664. MUX(1, 138, 1, 0xa00, 5, 0xa80, 5),
  2665. MUX(1, 137, 1, N, N, N, N),
  2666. };
  2667. static struct atlas7_grp_mux uart3_grp2_mux = {
  2668. .pad_mux_count = ARRAY_SIZE(uart3_grp2_pad_mux),
  2669. .pad_mux_list = uart3_grp2_pad_mux,
  2670. };
  2671. static struct atlas7_pad_mux uart3_grp3_pad_mux[] = {
  2672. MUX(1, 139, 2, N, N, N, N),
  2673. MUX(1, 140, 2, 0xa08, 0, 0xa88, 0),
  2674. MUX(1, 84, 2, 0xa00, 5, 0xa80, 5),
  2675. MUX(1, 83, 2, N, N, N, N),
  2676. };
  2677. static struct atlas7_grp_mux uart3_grp3_mux = {
  2678. .pad_mux_count = ARRAY_SIZE(uart3_grp3_pad_mux),
  2679. .pad_mux_list = uart3_grp3_pad_mux,
  2680. };
  2681. static struct atlas7_pad_mux uart3_nopause_grp0_pad_mux[] = {
  2682. MUX(1, 138, 1, 0xa00, 5, 0xa80, 5),
  2683. MUX(1, 137, 1, N, N, N, N),
  2684. };
  2685. static struct atlas7_grp_mux uart3_nopause_grp0_mux = {
  2686. .pad_mux_count = ARRAY_SIZE(uart3_nopause_grp0_pad_mux),
  2687. .pad_mux_list = uart3_nopause_grp0_pad_mux,
  2688. };
  2689. static struct atlas7_pad_mux uart3_nopause_grp1_pad_mux[] = {
  2690. MUX(1, 84, 2, 0xa00, 5, 0xa80, 5),
  2691. MUX(1, 83, 2, N, N, N, N),
  2692. };
  2693. static struct atlas7_grp_mux uart3_nopause_grp1_mux = {
  2694. .pad_mux_count = ARRAY_SIZE(uart3_nopause_grp1_pad_mux),
  2695. .pad_mux_list = uart3_nopause_grp1_pad_mux,
  2696. };
  2697. static struct atlas7_pad_mux uart4_grp0_pad_mux[] = {
  2698. MUX(1, 122, 4, 0xa08, 1, 0xa88, 1),
  2699. MUX(1, 123, 4, N, N, N, N),
  2700. MUX(1, 140, 1, N, N, N, N),
  2701. MUX(1, 139, 1, N, N, N, N),
  2702. };
  2703. static struct atlas7_grp_mux uart4_grp0_mux = {
  2704. .pad_mux_count = ARRAY_SIZE(uart4_grp0_pad_mux),
  2705. .pad_mux_list = uart4_grp0_pad_mux,
  2706. };
  2707. static struct atlas7_pad_mux uart4_grp1_pad_mux[] = {
  2708. MUX(1, 100, 4, 0xa08, 1, 0xa88, 1),
  2709. MUX(1, 99, 4, N, N, N, N),
  2710. MUX(1, 140, 1, N, N, N, N),
  2711. MUX(1, 139, 1, N, N, N, N),
  2712. };
  2713. static struct atlas7_grp_mux uart4_grp1_mux = {
  2714. .pad_mux_count = ARRAY_SIZE(uart4_grp1_pad_mux),
  2715. .pad_mux_list = uart4_grp1_pad_mux,
  2716. };
  2717. static struct atlas7_pad_mux uart4_grp2_pad_mux[] = {
  2718. MUX(1, 117, 2, 0xa08, 1, 0xa88, 1),
  2719. MUX(1, 116, 2, N, N, N, N),
  2720. MUX(1, 140, 1, N, N, N, N),
  2721. MUX(1, 139, 1, N, N, N, N),
  2722. };
  2723. static struct atlas7_grp_mux uart4_grp2_mux = {
  2724. .pad_mux_count = ARRAY_SIZE(uart4_grp2_pad_mux),
  2725. .pad_mux_list = uart4_grp2_pad_mux,
  2726. };
  2727. static struct atlas7_pad_mux uart4_nopause_grp_pad_mux[] = {
  2728. MUX(1, 140, 1, N, N, N, N),
  2729. MUX(1, 139, 1, N, N, N, N),
  2730. };
  2731. static struct atlas7_grp_mux uart4_nopause_grp_mux = {
  2732. .pad_mux_count = ARRAY_SIZE(uart4_nopause_grp_pad_mux),
  2733. .pad_mux_list = uart4_nopause_grp_pad_mux,
  2734. };
  2735. static struct atlas7_pad_mux usb0_drvvbus_grp_pad_mux[] = {
  2736. MUX(1, 51, 2, N, N, N, N),
  2737. };
  2738. static struct atlas7_grp_mux usb0_drvvbus_grp_mux = {
  2739. .pad_mux_count = ARRAY_SIZE(usb0_drvvbus_grp_pad_mux),
  2740. .pad_mux_list = usb0_drvvbus_grp_pad_mux,
  2741. };
  2742. static struct atlas7_pad_mux usb1_drvvbus_grp_pad_mux[] = {
  2743. MUX(1, 134, 2, N, N, N, N),
  2744. };
  2745. static struct atlas7_grp_mux usb1_drvvbus_grp_mux = {
  2746. .pad_mux_count = ARRAY_SIZE(usb1_drvvbus_grp_pad_mux),
  2747. .pad_mux_list = usb1_drvvbus_grp_pad_mux,
  2748. };
  2749. static struct atlas7_pad_mux visbus_dout_grp_pad_mux[] = {
  2750. MUX(1, 57, 6, N, N, N, N),
  2751. MUX(1, 58, 6, N, N, N, N),
  2752. MUX(1, 59, 6, N, N, N, N),
  2753. MUX(1, 60, 6, N, N, N, N),
  2754. MUX(1, 61, 6, N, N, N, N),
  2755. MUX(1, 62, 6, N, N, N, N),
  2756. MUX(1, 63, 6, N, N, N, N),
  2757. MUX(1, 64, 6, N, N, N, N),
  2758. MUX(1, 65, 6, N, N, N, N),
  2759. MUX(1, 66, 6, N, N, N, N),
  2760. MUX(1, 67, 6, N, N, N, N),
  2761. MUX(1, 68, 6, N, N, N, N),
  2762. MUX(1, 69, 6, N, N, N, N),
  2763. MUX(1, 70, 6, N, N, N, N),
  2764. MUX(1, 71, 6, N, N, N, N),
  2765. MUX(1, 72, 6, N, N, N, N),
  2766. MUX(1, 53, 6, N, N, N, N),
  2767. MUX(1, 54, 6, N, N, N, N),
  2768. MUX(1, 55, 6, N, N, N, N),
  2769. MUX(1, 56, 6, N, N, N, N),
  2770. MUX(1, 85, 6, N, N, N, N),
  2771. MUX(1, 86, 6, N, N, N, N),
  2772. MUX(1, 87, 6, N, N, N, N),
  2773. MUX(1, 88, 6, N, N, N, N),
  2774. MUX(1, 89, 6, N, N, N, N),
  2775. MUX(1, 90, 6, N, N, N, N),
  2776. MUX(1, 91, 6, N, N, N, N),
  2777. MUX(1, 92, 6, N, N, N, N),
  2778. MUX(1, 93, 6, N, N, N, N),
  2779. MUX(1, 94, 6, N, N, N, N),
  2780. MUX(1, 95, 6, N, N, N, N),
  2781. MUX(1, 96, 6, N, N, N, N),
  2782. };
  2783. static struct atlas7_grp_mux visbus_dout_grp_mux = {
  2784. .pad_mux_count = ARRAY_SIZE(visbus_dout_grp_pad_mux),
  2785. .pad_mux_list = visbus_dout_grp_pad_mux,
  2786. };
  2787. static struct atlas7_pad_mux vi_vip1_grp_pad_mux[] = {
  2788. MUX(1, 74, 1, N, N, N, N),
  2789. MUX(1, 75, 1, N, N, N, N),
  2790. MUX(1, 76, 1, N, N, N, N),
  2791. MUX(1, 77, 1, N, N, N, N),
  2792. MUX(1, 78, 1, N, N, N, N),
  2793. MUX(1, 79, 1, N, N, N, N),
  2794. MUX(1, 80, 1, N, N, N, N),
  2795. MUX(1, 81, 1, N, N, N, N),
  2796. MUX(1, 82, 1, N, N, N, N),
  2797. MUX(1, 83, 1, N, N, N, N),
  2798. MUX(1, 84, 1, N, N, N, N),
  2799. MUX(1, 103, 2, N, N, N, N),
  2800. MUX(1, 104, 2, N, N, N, N),
  2801. MUX(1, 105, 2, N, N, N, N),
  2802. MUX(1, 106, 2, N, N, N, N),
  2803. MUX(1, 107, 2, N, N, N, N),
  2804. MUX(1, 102, 2, N, N, N, N),
  2805. MUX(1, 97, 2, N, N, N, N),
  2806. MUX(1, 98, 2, N, N, N, N),
  2807. };
  2808. static struct atlas7_grp_mux vi_vip1_grp_mux = {
  2809. .pad_mux_count = ARRAY_SIZE(vi_vip1_grp_pad_mux),
  2810. .pad_mux_list = vi_vip1_grp_pad_mux,
  2811. };
  2812. static struct atlas7_pad_mux vi_vip1_ext_grp_pad_mux[] = {
  2813. MUX(1, 74, 1, N, N, N, N),
  2814. MUX(1, 75, 1, N, N, N, N),
  2815. MUX(1, 76, 1, N, N, N, N),
  2816. MUX(1, 77, 1, N, N, N, N),
  2817. MUX(1, 78, 1, N, N, N, N),
  2818. MUX(1, 79, 1, N, N, N, N),
  2819. MUX(1, 80, 1, N, N, N, N),
  2820. MUX(1, 81, 1, N, N, N, N),
  2821. MUX(1, 82, 1, N, N, N, N),
  2822. MUX(1, 83, 1, N, N, N, N),
  2823. MUX(1, 84, 1, N, N, N, N),
  2824. MUX(1, 108, 2, N, N, N, N),
  2825. MUX(1, 103, 2, N, N, N, N),
  2826. MUX(1, 104, 2, N, N, N, N),
  2827. MUX(1, 105, 2, N, N, N, N),
  2828. MUX(1, 106, 2, N, N, N, N),
  2829. MUX(1, 107, 2, N, N, N, N),
  2830. MUX(1, 102, 2, N, N, N, N),
  2831. MUX(1, 97, 2, N, N, N, N),
  2832. MUX(1, 98, 2, N, N, N, N),
  2833. MUX(1, 99, 2, N, N, N, N),
  2834. MUX(1, 100, 2, N, N, N, N),
  2835. };
  2836. static struct atlas7_grp_mux vi_vip1_ext_grp_mux = {
  2837. .pad_mux_count = ARRAY_SIZE(vi_vip1_ext_grp_pad_mux),
  2838. .pad_mux_list = vi_vip1_ext_grp_pad_mux,
  2839. };
  2840. static struct atlas7_pad_mux vi_vip1_low8bit_grp_pad_mux[] = {
  2841. MUX(1, 74, 1, N, N, N, N),
  2842. MUX(1, 75, 1, N, N, N, N),
  2843. MUX(1, 76, 1, N, N, N, N),
  2844. MUX(1, 77, 1, N, N, N, N),
  2845. MUX(1, 78, 1, N, N, N, N),
  2846. MUX(1, 79, 1, N, N, N, N),
  2847. MUX(1, 80, 1, N, N, N, N),
  2848. MUX(1, 81, 1, N, N, N, N),
  2849. };
  2850. static struct atlas7_grp_mux vi_vip1_low8bit_grp_mux = {
  2851. .pad_mux_count = ARRAY_SIZE(vi_vip1_low8bit_grp_pad_mux),
  2852. .pad_mux_list = vi_vip1_low8bit_grp_pad_mux,
  2853. };
  2854. static struct atlas7_pad_mux vi_vip1_high8bit_grp_pad_mux[] = {
  2855. MUX(1, 82, 1, N, N, N, N),
  2856. MUX(1, 83, 1, N, N, N, N),
  2857. MUX(1, 84, 1, N, N, N, N),
  2858. MUX(1, 108, 2, N, N, N, N),
  2859. MUX(1, 103, 2, N, N, N, N),
  2860. MUX(1, 104, 2, N, N, N, N),
  2861. MUX(1, 105, 2, N, N, N, N),
  2862. MUX(1, 106, 2, N, N, N, N),
  2863. };
  2864. static struct atlas7_grp_mux vi_vip1_high8bit_grp_mux = {
  2865. .pad_mux_count = ARRAY_SIZE(vi_vip1_high8bit_grp_pad_mux),
  2866. .pad_mux_list = vi_vip1_high8bit_grp_pad_mux,
  2867. };
  2868. static struct atlas7_pmx_func atlas7_pmx_functions[] = {
  2869. FUNCTION("gnss_gpio", gnss_gpio_grp, &gnss_gpio_grp_mux),
  2870. FUNCTION("lcd_vip_gpio", lcd_vip_gpio_grp, &lcd_vip_gpio_grp_mux),
  2871. FUNCTION("sdio_i2s_gpio", sdio_i2s_gpio_grp, &sdio_i2s_gpio_grp_mux),
  2872. FUNCTION("sp_rgmii_gpio", sp_rgmii_gpio_grp, &sp_rgmii_gpio_grp_mux),
  2873. FUNCTION("lvds_gpio", lvds_gpio_grp, &lvds_gpio_grp_mux),
  2874. FUNCTION("uart_nand_gpio",
  2875. uart_nand_gpio_grp,
  2876. &uart_nand_gpio_grp_mux),
  2877. FUNCTION("rtc_gpio", rtc_gpio_grp, &rtc_gpio_grp_mux),
  2878. FUNCTION("audio_ac97", audio_ac97_grp, &audio_ac97_grp_mux),
  2879. FUNCTION("audio_func_dbg",
  2880. audio_func_dbg_grp,
  2881. &audio_func_dbg_grp_mux),
  2882. FUNCTION("audio_i2s", audio_i2s_grp, &audio_i2s_grp_mux),
  2883. FUNCTION("audio_i2s_2ch", audio_i2s_2ch_grp, &audio_i2s_2ch_grp_mux),
  2884. FUNCTION("audio_i2s_extclk",
  2885. audio_i2s_extclk_grp,
  2886. &audio_i2s_extclk_grp_mux),
  2887. FUNCTION("audio_uart0", audio_uart0_grp, &audio_uart0_grp_mux),
  2888. FUNCTION("audio_uart1", audio_uart1_grp, &audio_uart1_grp_mux),
  2889. FUNCTION("audio_uart2_m0", audio_uart2_grp0, &audio_uart2_grp0_mux),
  2890. FUNCTION("audio_uart2_m1", audio_uart2_grp1, &audio_uart2_grp1_mux),
  2891. FUNCTION("c_can_trnsvr", c_can_trnsvr_grp, &c_can_trnsvr_grp_mux),
  2892. FUNCTION("c0_can_m0", c0_can_grp0, &c0_can_grp0_mux),
  2893. FUNCTION("c0_can_m1", c0_can_grp1, &c0_can_grp1_mux),
  2894. FUNCTION("c1_can_m0", c1_can_grp0, &c1_can_grp0_mux),
  2895. FUNCTION("c1_can_m1", c1_can_grp1, &c1_can_grp1_mux),
  2896. FUNCTION("c1_can_m2", c1_can_grp2, &c1_can_grp2_mux),
  2897. FUNCTION("ca_audio_lpc", ca_audio_lpc_grp, &ca_audio_lpc_grp_mux),
  2898. FUNCTION("ca_bt_lpc", ca_bt_lpc_grp, &ca_bt_lpc_grp_mux),
  2899. FUNCTION("ca_coex", ca_coex_grp, &ca_coex_grp_mux),
  2900. FUNCTION("ca_curator_lpc",
  2901. ca_curator_lpc_grp,
  2902. &ca_curator_lpc_grp_mux),
  2903. FUNCTION("ca_pcm_debug", ca_pcm_debug_grp, &ca_pcm_debug_grp_mux),
  2904. FUNCTION("ca_pio", ca_pio_grp, &ca_pio_grp_mux),
  2905. FUNCTION("ca_sdio_debug", ca_sdio_debug_grp, &ca_sdio_debug_grp_mux),
  2906. FUNCTION("ca_spi", ca_spi_grp, &ca_spi_grp_mux),
  2907. FUNCTION("ca_trb", ca_trb_grp, &ca_trb_grp_mux),
  2908. FUNCTION("ca_uart_debug", ca_uart_debug_grp, &ca_uart_debug_grp_mux),
  2909. FUNCTION("clkc_m0", clkc_grp0, &clkc_grp0_mux),
  2910. FUNCTION("clkc_m1", clkc_grp1, &clkc_grp1_mux),
  2911. FUNCTION("gn_gnss_i2c", gn_gnss_i2c_grp, &gn_gnss_i2c_grp_mux),
  2912. FUNCTION("gn_gnss_uart_nopause",
  2913. gn_gnss_uart_nopause_grp,
  2914. &gn_gnss_uart_nopause_grp_mux),
  2915. FUNCTION("gn_gnss_uart", gn_gnss_uart_grp, &gn_gnss_uart_grp_mux),
  2916. FUNCTION("gn_trg_spi_m0", gn_trg_spi_grp0, &gn_trg_spi_grp0_mux),
  2917. FUNCTION("gn_trg_spi_m1", gn_trg_spi_grp1, &gn_trg_spi_grp1_mux),
  2918. FUNCTION("cvbs_dbg", cvbs_dbg_grp, &cvbs_dbg_grp_mux),
  2919. FUNCTION("cvbs_dbg_test_m0",
  2920. cvbs_dbg_test_grp0,
  2921. &cvbs_dbg_test_grp0_mux),
  2922. FUNCTION("cvbs_dbg_test_m1",
  2923. cvbs_dbg_test_grp1,
  2924. &cvbs_dbg_test_grp1_mux),
  2925. FUNCTION("cvbs_dbg_test_m2",
  2926. cvbs_dbg_test_grp2,
  2927. &cvbs_dbg_test_grp2_mux),
  2928. FUNCTION("cvbs_dbg_test_m3",
  2929. cvbs_dbg_test_grp3,
  2930. &cvbs_dbg_test_grp3_mux),
  2931. FUNCTION("cvbs_dbg_test_m4",
  2932. cvbs_dbg_test_grp4,
  2933. &cvbs_dbg_test_grp4_mux),
  2934. FUNCTION("cvbs_dbg_test_m5",
  2935. cvbs_dbg_test_grp5,
  2936. &cvbs_dbg_test_grp5_mux),
  2937. FUNCTION("cvbs_dbg_test_m6",
  2938. cvbs_dbg_test_grp6,
  2939. &cvbs_dbg_test_grp6_mux),
  2940. FUNCTION("cvbs_dbg_test_m7",
  2941. cvbs_dbg_test_grp7,
  2942. &cvbs_dbg_test_grp7_mux),
  2943. FUNCTION("cvbs_dbg_test_m8",
  2944. cvbs_dbg_test_grp8,
  2945. &cvbs_dbg_test_grp8_mux),
  2946. FUNCTION("cvbs_dbg_test_m9",
  2947. cvbs_dbg_test_grp9,
  2948. &cvbs_dbg_test_grp9_mux),
  2949. FUNCTION("cvbs_dbg_test_m10",
  2950. cvbs_dbg_test_grp10,
  2951. &cvbs_dbg_test_grp10_mux),
  2952. FUNCTION("cvbs_dbg_test_m11",
  2953. cvbs_dbg_test_grp11,
  2954. &cvbs_dbg_test_grp11_mux),
  2955. FUNCTION("cvbs_dbg_test_m12",
  2956. cvbs_dbg_test_grp12,
  2957. &cvbs_dbg_test_grp12_mux),
  2958. FUNCTION("cvbs_dbg_test_m13",
  2959. cvbs_dbg_test_grp13,
  2960. &cvbs_dbg_test_grp13_mux),
  2961. FUNCTION("cvbs_dbg_test_m14",
  2962. cvbs_dbg_test_grp14,
  2963. &cvbs_dbg_test_grp14_mux),
  2964. FUNCTION("cvbs_dbg_test_m15",
  2965. cvbs_dbg_test_grp15,
  2966. &cvbs_dbg_test_grp15_mux),
  2967. FUNCTION("gn_gnss_power", gn_gnss_power_grp, &gn_gnss_power_grp_mux),
  2968. FUNCTION("gn_gnss_sw_status",
  2969. gn_gnss_sw_status_grp,
  2970. &gn_gnss_sw_status_grp_mux),
  2971. FUNCTION("gn_gnss_eclk", gn_gnss_eclk_grp, &gn_gnss_eclk_grp_mux),
  2972. FUNCTION("gn_gnss_irq1_m0",
  2973. gn_gnss_irq1_grp0,
  2974. &gn_gnss_irq1_grp0_mux),
  2975. FUNCTION("gn_gnss_irq2_m0",
  2976. gn_gnss_irq2_grp0,
  2977. &gn_gnss_irq2_grp0_mux),
  2978. FUNCTION("gn_gnss_tm", gn_gnss_tm_grp, &gn_gnss_tm_grp_mux),
  2979. FUNCTION("gn_gnss_tsync", gn_gnss_tsync_grp, &gn_gnss_tsync_grp_mux),
  2980. FUNCTION("gn_io_gnsssys_sw_cfg",
  2981. gn_io_gnsssys_sw_cfg_grp,
  2982. &gn_io_gnsssys_sw_cfg_grp_mux),
  2983. FUNCTION("gn_trg_m0", gn_trg_grp0, &gn_trg_grp0_mux),
  2984. FUNCTION("gn_trg_m1", gn_trg_grp1, &gn_trg_grp1_mux),
  2985. FUNCTION("gn_trg_shutdown_m0",
  2986. gn_trg_shutdown_grp0,
  2987. &gn_trg_shutdown_grp0_mux),
  2988. FUNCTION("gn_trg_shutdown_m1",
  2989. gn_trg_shutdown_grp1,
  2990. &gn_trg_shutdown_grp1_mux),
  2991. FUNCTION("gn_trg_shutdown_m2",
  2992. gn_trg_shutdown_grp2,
  2993. &gn_trg_shutdown_grp2_mux),
  2994. FUNCTION("gn_trg_shutdown_m3",
  2995. gn_trg_shutdown_grp3,
  2996. &gn_trg_shutdown_grp3_mux),
  2997. FUNCTION("i2c0", i2c0_grp, &i2c0_grp_mux),
  2998. FUNCTION("i2c1", i2c1_grp, &i2c1_grp_mux),
  2999. FUNCTION("jtag_m0", jtag_grp0, &jtag_grp0_mux),
  3000. FUNCTION("ks_kas_spi_m0", ks_kas_spi_grp0, &ks_kas_spi_grp0_mux),
  3001. FUNCTION("ld_ldd", ld_ldd_grp, &ld_ldd_grp_mux),
  3002. FUNCTION("ld_ldd_16bit", ld_ldd_16bit_grp, &ld_ldd_16bit_grp_mux),
  3003. FUNCTION("ld_ldd_fck", ld_ldd_fck_grp, &ld_ldd_fck_grp_mux),
  3004. FUNCTION("ld_ldd_lck", ld_ldd_lck_grp, &ld_ldd_lck_grp_mux),
  3005. FUNCTION("lr_lcdrom", lr_lcdrom_grp, &lr_lcdrom_grp_mux),
  3006. FUNCTION("lvds_analog", lvds_analog_grp, &lvds_analog_grp_mux),
  3007. FUNCTION("nd_df", nd_df_grp, &nd_df_grp_mux),
  3008. FUNCTION("nd_df_nowp", nd_df_nowp_grp, &nd_df_nowp_grp_mux),
  3009. FUNCTION("ps", ps_grp, &ps_grp_mux),
  3010. FUNCTION("pwc_core_on", pwc_core_on_grp, &pwc_core_on_grp_mux),
  3011. FUNCTION("pwc_ext_on", pwc_ext_on_grp, &pwc_ext_on_grp_mux),
  3012. FUNCTION("pwc_gpio3_clk", pwc_gpio3_clk_grp, &pwc_gpio3_clk_grp_mux),
  3013. FUNCTION("pwc_io_on", pwc_io_on_grp, &pwc_io_on_grp_mux),
  3014. FUNCTION("pwc_lowbatt_b_m0",
  3015. pwc_lowbatt_b_grp0,
  3016. &pwc_lowbatt_b_grp0_mux),
  3017. FUNCTION("pwc_mem_on", pwc_mem_on_grp, &pwc_mem_on_grp_mux),
  3018. FUNCTION("pwc_on_key_b_m0",
  3019. pwc_on_key_b_grp0,
  3020. &pwc_on_key_b_grp0_mux),
  3021. FUNCTION("pwc_wakeup_src0",
  3022. pwc_wakeup_src0_grp,
  3023. &pwc_wakeup_src0_grp_mux),
  3024. FUNCTION("pwc_wakeup_src1",
  3025. pwc_wakeup_src1_grp,
  3026. &pwc_wakeup_src1_grp_mux),
  3027. FUNCTION("pwc_wakeup_src2",
  3028. pwc_wakeup_src2_grp,
  3029. &pwc_wakeup_src2_grp_mux),
  3030. FUNCTION("pwc_wakeup_src3",
  3031. pwc_wakeup_src3_grp,
  3032. &pwc_wakeup_src3_grp_mux),
  3033. FUNCTION("pw_cko0_m0", pw_cko0_grp0, &pw_cko0_grp0_mux),
  3034. FUNCTION("pw_cko0_m1", pw_cko0_grp1, &pw_cko0_grp1_mux),
  3035. FUNCTION("pw_cko0_m2", pw_cko0_grp2, &pw_cko0_grp2_mux),
  3036. FUNCTION("pw_cko1_m0", pw_cko1_grp0, &pw_cko1_grp0_mux),
  3037. FUNCTION("pw_cko1_m1", pw_cko1_grp1, &pw_cko1_grp1_mux),
  3038. FUNCTION("pw_i2s01_clk_m0",
  3039. pw_i2s01_clk_grp0,
  3040. &pw_i2s01_clk_grp0_mux),
  3041. FUNCTION("pw_i2s01_clk_m1",
  3042. pw_i2s01_clk_grp1,
  3043. &pw_i2s01_clk_grp1_mux),
  3044. FUNCTION("pw_pwm0", pw_pwm0_grp, &pw_pwm0_grp_mux),
  3045. FUNCTION("pw_pwm1", pw_pwm1_grp, &pw_pwm1_grp_mux),
  3046. FUNCTION("pw_pwm2_m0", pw_pwm2_grp0, &pw_pwm2_grp0_mux),
  3047. FUNCTION("pw_pwm2_m1", pw_pwm2_grp1, &pw_pwm2_grp1_mux),
  3048. FUNCTION("pw_pwm3_m0", pw_pwm3_grp0, &pw_pwm3_grp0_mux),
  3049. FUNCTION("pw_pwm3_m1", pw_pwm3_grp1, &pw_pwm3_grp1_mux),
  3050. FUNCTION("pw_pwm_cpu_vol_m0",
  3051. pw_pwm_cpu_vol_grp0,
  3052. &pw_pwm_cpu_vol_grp0_mux),
  3053. FUNCTION("pw_pwm_cpu_vol_m1",
  3054. pw_pwm_cpu_vol_grp1,
  3055. &pw_pwm_cpu_vol_grp1_mux),
  3056. FUNCTION("pw_backlight_m0",
  3057. pw_backlight_grp0,
  3058. &pw_backlight_grp0_mux),
  3059. FUNCTION("pw_backlight_m1",
  3060. pw_backlight_grp1,
  3061. &pw_backlight_grp1_mux),
  3062. FUNCTION("rg_eth_mac", rg_eth_mac_grp, &rg_eth_mac_grp_mux),
  3063. FUNCTION("rg_gmac_phy_intr_n",
  3064. rg_gmac_phy_intr_n_grp,
  3065. &rg_gmac_phy_intr_n_grp_mux),
  3066. FUNCTION("rg_rgmii_mac", rg_rgmii_mac_grp, &rg_rgmii_mac_grp_mux),
  3067. FUNCTION("rg_rgmii_phy_ref_clk_m0",
  3068. rg_rgmii_phy_ref_clk_grp0,
  3069. &rg_rgmii_phy_ref_clk_grp0_mux),
  3070. FUNCTION("rg_rgmii_phy_ref_clk_m1",
  3071. rg_rgmii_phy_ref_clk_grp1,
  3072. &rg_rgmii_phy_ref_clk_grp1_mux),
  3073. FUNCTION("sd0", sd0_grp, &sd0_grp_mux),
  3074. FUNCTION("sd0_4bit", sd0_4bit_grp, &sd0_4bit_grp_mux),
  3075. FUNCTION("sd1", sd1_grp, &sd1_grp_mux),
  3076. FUNCTION("sd1_4bit_m0", sd1_4bit_grp0, &sd1_4bit_grp0_mux),
  3077. FUNCTION("sd1_4bit_m1", sd1_4bit_grp1, &sd1_4bit_grp1_mux),
  3078. FUNCTION("sd2_m0", sd2_grp0, &sd2_grp0_mux),
  3079. FUNCTION("sd2_no_cdb_m0", sd2_no_cdb_grp0, &sd2_no_cdb_grp0_mux),
  3080. FUNCTION("sd3", sd3_grp, &sd3_grp_mux),
  3081. FUNCTION("sd5", sd5_grp, &sd5_grp_mux),
  3082. FUNCTION("sd6_m0", sd6_grp0, &sd6_grp0_mux),
  3083. FUNCTION("sd6_m1", sd6_grp1, &sd6_grp1_mux),
  3084. FUNCTION("sp0_ext_ldo_on",
  3085. sp0_ext_ldo_on_grp,
  3086. &sp0_ext_ldo_on_grp_mux),
  3087. FUNCTION("sp0_qspi", sp0_qspi_grp, &sp0_qspi_grp_mux),
  3088. FUNCTION("sp1_spi", sp1_spi_grp, &sp1_spi_grp_mux),
  3089. FUNCTION("tpiu_trace", tpiu_trace_grp, &tpiu_trace_grp_mux),
  3090. FUNCTION("uart0", uart0_grp, &uart0_grp_mux),
  3091. FUNCTION("uart0_nopause", uart0_nopause_grp, &uart0_nopause_grp_mux),
  3092. FUNCTION("uart1", uart1_grp, &uart1_grp_mux),
  3093. FUNCTION("uart2", uart2_grp, &uart2_grp_mux),
  3094. FUNCTION("uart3_m0", uart3_grp0, &uart3_grp0_mux),
  3095. FUNCTION("uart3_m1", uart3_grp1, &uart3_grp1_mux),
  3096. FUNCTION("uart3_m2", uart3_grp2, &uart3_grp2_mux),
  3097. FUNCTION("uart3_m3", uart3_grp3, &uart3_grp3_mux),
  3098. FUNCTION("uart3_nopause_m0",
  3099. uart3_nopause_grp0,
  3100. &uart3_nopause_grp0_mux),
  3101. FUNCTION("uart3_nopause_m1",
  3102. uart3_nopause_grp1,
  3103. &uart3_nopause_grp1_mux),
  3104. FUNCTION("uart4_m0", uart4_grp0, &uart4_grp0_mux),
  3105. FUNCTION("uart4_m1", uart4_grp1, &uart4_grp1_mux),
  3106. FUNCTION("uart4_m2", uart4_grp2, &uart4_grp2_mux),
  3107. FUNCTION("uart4_nopause", uart4_nopause_grp, &uart4_nopause_grp_mux),
  3108. FUNCTION("usb0_drvvbus", usb0_drvvbus_grp, &usb0_drvvbus_grp_mux),
  3109. FUNCTION("usb1_drvvbus", usb1_drvvbus_grp, &usb1_drvvbus_grp_mux),
  3110. FUNCTION("visbus_dout", visbus_dout_grp, &visbus_dout_grp_mux),
  3111. FUNCTION("vi_vip1", vi_vip1_grp, &vi_vip1_grp_mux),
  3112. FUNCTION("vi_vip1_ext", vi_vip1_ext_grp, &vi_vip1_ext_grp_mux),
  3113. FUNCTION("vi_vip1_low8bit",
  3114. vi_vip1_low8bit_grp,
  3115. &vi_vip1_low8bit_grp_mux),
  3116. FUNCTION("vi_vip1_high8bit",
  3117. vi_vip1_high8bit_grp,
  3118. &vi_vip1_high8bit_grp_mux),
  3119. };
  3120. struct atlas7_pinctrl_data atlas7_ioc_data = {
  3121. .pads = (struct pinctrl_pin_desc *)atlas7_ioc_pads,
  3122. .pads_cnt = ARRAY_SIZE(atlas7_ioc_pads),
  3123. .grps = (struct atlas7_pin_group *)altas7_pin_groups,
  3124. .grps_cnt = ARRAY_SIZE(altas7_pin_groups),
  3125. .funcs = (struct atlas7_pmx_func *)atlas7_pmx_functions,
  3126. .funcs_cnt = ARRAY_SIZE(atlas7_pmx_functions),
  3127. .confs = (struct atlas7_pad_config *)atlas7_ioc_pad_confs,
  3128. .confs_cnt = ARRAY_SIZE(atlas7_ioc_pad_confs),
  3129. };
  3130. static inline u32 atlas7_pin_to_bank(u32 pin)
  3131. {
  3132. return (pin >= ATLAS7_PINCTRL_BANK_0_PINS) ? 1 : 0;
  3133. }
  3134. static int atlas7_pmx_get_funcs_count(struct pinctrl_dev *pctldev)
  3135. {
  3136. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  3137. return pmx->pctl_data->funcs_cnt;
  3138. }
  3139. static const char *atlas7_pmx_get_func_name(struct pinctrl_dev *pctldev,
  3140. u32 selector)
  3141. {
  3142. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  3143. return pmx->pctl_data->funcs[selector].name;
  3144. }
  3145. static int atlas7_pmx_get_func_groups(struct pinctrl_dev *pctldev,
  3146. u32 selector, const char * const **groups,
  3147. u32 * const num_groups)
  3148. {
  3149. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  3150. *groups = pmx->pctl_data->funcs[selector].groups;
  3151. *num_groups = pmx->pctl_data->funcs[selector].num_groups;
  3152. return 0;
  3153. }
  3154. static void __atlas7_pmx_pin_input_disable_set(struct atlas7_pmx *pmx,
  3155. const struct atlas7_pad_mux *mux)
  3156. {
  3157. /* Set Input Disable to avoid input glitches
  3158. *
  3159. * All Input-Disable Control registers are located on IOCRTC.
  3160. * So the regs bank is always 0.
  3161. *
  3162. */
  3163. if (mux->dinput_reg && mux->dinput_val_reg) {
  3164. writel(DI_MASK << mux->dinput_bit,
  3165. pmx->regs[BANK_DS] + CLR_REG(mux->dinput_reg));
  3166. writel(DI_DISABLE << mux->dinput_bit,
  3167. pmx->regs[BANK_DS] + mux->dinput_reg);
  3168. writel(DIV_MASK << mux->dinput_val_bit,
  3169. pmx->regs[BANK_DS] + CLR_REG(mux->dinput_val_reg));
  3170. writel(DIV_DISABLE << mux->dinput_val_bit,
  3171. pmx->regs[BANK_DS] + mux->dinput_val_reg);
  3172. }
  3173. }
  3174. static void __atlas7_pmx_pin_input_disable_clr(struct atlas7_pmx *pmx,
  3175. const struct atlas7_pad_mux *mux)
  3176. {
  3177. /* Clear Input Disable to avoid input glitches */
  3178. if (mux->dinput_reg && mux->dinput_val_reg) {
  3179. writel(DI_MASK << mux->dinput_bit,
  3180. pmx->regs[BANK_DS] + CLR_REG(mux->dinput_reg));
  3181. writel(DI_ENABLE << mux->dinput_bit,
  3182. pmx->regs[BANK_DS] + mux->dinput_reg);
  3183. writel(DIV_MASK << mux->dinput_val_bit,
  3184. pmx->regs[BANK_DS] + CLR_REG(mux->dinput_val_reg));
  3185. writel(DIV_ENABLE << mux->dinput_val_bit,
  3186. pmx->regs[BANK_DS] + mux->dinput_val_reg);
  3187. }
  3188. }
  3189. static int __atlas7_pmx_pin_ad_sel(struct atlas7_pmx *pmx,
  3190. struct atlas7_pad_config *conf,
  3191. u32 bank, u32 ad_sel)
  3192. {
  3193. unsigned long regv;
  3194. /* Write to clear register to clear A/D selector */
  3195. writel(ANA_CLEAR_MASK << conf->ad_ctrl_bit,
  3196. pmx->regs[bank] + CLR_REG(conf->ad_ctrl_reg));
  3197. /* Set target pad A/D selector */
  3198. regv = readl(pmx->regs[bank] + conf->ad_ctrl_reg);
  3199. regv &= ~(ANA_CLEAR_MASK << conf->ad_ctrl_bit);
  3200. writel(regv | (ad_sel << conf->ad_ctrl_bit),
  3201. pmx->regs[bank] + conf->ad_ctrl_reg);
  3202. regv = readl(pmx->regs[bank] + conf->ad_ctrl_reg);
  3203. pr_debug("bank:%d reg:0x%04x val:0x%08lx\n",
  3204. bank, conf->ad_ctrl_reg, regv);
  3205. return 0;
  3206. }
  3207. static int __atlas7_pmx_pin_analog_enable(struct atlas7_pmx *pmx,
  3208. struct atlas7_pad_config *conf, u32 bank)
  3209. {
  3210. /* Only PAD_T_AD pins can change between Analogue&Digital */
  3211. if (conf->type != PAD_T_AD)
  3212. return -EINVAL;
  3213. return __atlas7_pmx_pin_ad_sel(pmx, conf, bank, 0);
  3214. }
  3215. static int __atlas7_pmx_pin_digital_enable(struct atlas7_pmx *pmx,
  3216. struct atlas7_pad_config *conf, u32 bank)
  3217. {
  3218. /* Other type pads are always digital */
  3219. if (conf->type != PAD_T_AD)
  3220. return 0;
  3221. return __atlas7_pmx_pin_ad_sel(pmx, conf, bank, 1);
  3222. }
  3223. static int __atlas7_pmx_pin_enable(struct atlas7_pmx *pmx,
  3224. u32 pin, u32 func)
  3225. {
  3226. struct atlas7_pad_config *conf;
  3227. u32 bank;
  3228. int ret;
  3229. unsigned long regv;
  3230. pr_debug("PMX DUMP ### pin#%d func:%d #### START >>>\n",
  3231. pin, func);
  3232. /* Get this Pad's descriptor from PINCTRL */
  3233. conf = &pmx->pctl_data->confs[pin];
  3234. bank = atlas7_pin_to_bank(pin);
  3235. /* Just enable the analog function of this pad */
  3236. if (FUNC_ANALOGUE == func) {
  3237. ret = __atlas7_pmx_pin_analog_enable(pmx, conf, bank);
  3238. if (ret)
  3239. dev_err(pmx->dev,
  3240. "Convert pad#%d to analog failed, ret=%d\n",
  3241. pin, ret);
  3242. return ret;
  3243. }
  3244. /* Set Pads from analog to digital */
  3245. ret = __atlas7_pmx_pin_digital_enable(pmx, conf, bank);
  3246. if (ret) {
  3247. dev_err(pmx->dev,
  3248. "Convert pad#%d to digital failed, ret=%d\n",
  3249. pin, ret);
  3250. return ret;
  3251. }
  3252. /* Write to clear register to clear current function */
  3253. writel(FUNC_CLEAR_MASK << conf->mux_bit,
  3254. pmx->regs[bank] + CLR_REG(conf->mux_reg));
  3255. /* Set target pad mux function */
  3256. regv = readl(pmx->regs[bank] + conf->mux_reg);
  3257. regv &= ~(FUNC_CLEAR_MASK << conf->mux_bit);
  3258. writel(regv | (func << conf->mux_bit),
  3259. pmx->regs[bank] + conf->mux_reg);
  3260. regv = readl(pmx->regs[bank] + conf->mux_reg);
  3261. pr_debug("bank:%d reg:0x%04x val:0x%08lx\n",
  3262. bank, conf->mux_reg, regv);
  3263. return 0;
  3264. }
  3265. static int atlas7_pmx_set_mux(struct pinctrl_dev *pctldev,
  3266. u32 func_selector, u32 group_selector)
  3267. {
  3268. int idx, ret;
  3269. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  3270. struct atlas7_pmx_func *pmx_func;
  3271. struct atlas7_pin_group *pin_grp;
  3272. const struct atlas7_grp_mux *grp_mux;
  3273. const struct atlas7_pad_mux *mux;
  3274. pmx_func = &pmx->pctl_data->funcs[func_selector];
  3275. pin_grp = &pmx->pctl_data->grps[group_selector];
  3276. pr_debug("PMX DUMP ### Function:[%s] Group:[%s] #### START >>>\n",
  3277. pmx_func->name, pin_grp->name);
  3278. grp_mux = pmx_func->grpmux;
  3279. for (idx = 0; idx < grp_mux->pad_mux_count; idx++) {
  3280. mux = &grp_mux->pad_mux_list[idx];
  3281. __atlas7_pmx_pin_input_disable_set(pmx, mux);
  3282. ret = __atlas7_pmx_pin_enable(pmx, mux->pin, mux->func);
  3283. if (ret) {
  3284. dev_err(pmx->dev,
  3285. "FUNC:%s GRP:%s PIN#%d.%d failed, ret=%d\n",
  3286. pmx_func->name, pin_grp->name,
  3287. mux->pin, mux->func, ret);
  3288. BUG_ON(1);
  3289. }
  3290. __atlas7_pmx_pin_input_disable_clr(pmx, mux);
  3291. }
  3292. pr_debug("PMX DUMP ### Function:[%s] Group:[%s] #### END <<<\n",
  3293. pmx_func->name, pin_grp->name);
  3294. return 0;
  3295. }
  3296. struct atlas7_ds_info {
  3297. u32 ma;
  3298. u32 ds_16st;
  3299. u32 ds_4we;
  3300. u32 ds_0204m31;
  3301. u32 ds_0610m31;
  3302. };
  3303. const struct atlas7_ds_info atlas7_ds_map[] = {
  3304. { 2, DS_16ST_0, DS_4WE_0, DS_M31_0, DS_NULL},
  3305. { 4, DS_16ST_1, DS_NULL, DS_M31_1, DS_NULL},
  3306. { 6, DS_16ST_2, DS_NULL, DS_NULL, DS_M31_0},
  3307. { 8, DS_16ST_3, DS_4WE_1, DS_NULL, DS_NULL},
  3308. { 10, DS_16ST_4, DS_NULL, DS_NULL, DS_M31_1},
  3309. { 12, DS_16ST_5, DS_NULL, DS_NULL, DS_NULL},
  3310. { 14, DS_16ST_6, DS_NULL, DS_NULL, DS_NULL},
  3311. { 16, DS_16ST_7, DS_4WE_2, DS_NULL, DS_NULL},
  3312. { 18, DS_16ST_8, DS_NULL, DS_NULL, DS_NULL},
  3313. { 20, DS_16ST_9, DS_NULL, DS_NULL, DS_NULL},
  3314. { 22, DS_16ST_10, DS_NULL, DS_NULL, DS_NULL},
  3315. { 24, DS_16ST_11, DS_NULL, DS_NULL, DS_NULL},
  3316. { 26, DS_16ST_12, DS_NULL, DS_NULL, DS_NULL},
  3317. { 28, DS_16ST_13, DS_4WE_3, DS_NULL, DS_NULL},
  3318. { 30, DS_16ST_14, DS_NULL, DS_NULL, DS_NULL},
  3319. { 32, DS_16ST_15, DS_NULL, DS_NULL, DS_NULL},
  3320. };
  3321. static u32 convert_current_to_drive_strength(u32 type, u32 ma)
  3322. {
  3323. int idx;
  3324. for (idx = 0; idx < ARRAY_SIZE(atlas7_ds_map); idx++) {
  3325. if (atlas7_ds_map[idx].ma != ma)
  3326. continue;
  3327. if (type == PAD_T_4WE_PD || type == PAD_T_4WE_PU)
  3328. return atlas7_ds_map[idx].ds_4we;
  3329. else if (type == PAD_T_16ST)
  3330. return atlas7_ds_map[idx].ds_16st;
  3331. else if (type == PAD_T_M31_0204_PD || type == PAD_T_M31_0204_PU)
  3332. return atlas7_ds_map[idx].ds_0204m31;
  3333. else if (type == PAD_T_M31_0610_PD || type == PAD_T_M31_0610_PU)
  3334. return atlas7_ds_map[idx].ds_0610m31;
  3335. }
  3336. return DS_NULL;
  3337. }
  3338. static int altas7_pinctrl_set_pull_sel(struct pinctrl_dev *pctldev,
  3339. u32 pin, u32 sel)
  3340. {
  3341. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  3342. struct atlas7_pad_config *conf = &pmx->pctl_data->confs[pin];
  3343. u32 type = conf->type;
  3344. u32 shift = conf->pupd_bit;
  3345. u32 bank = atlas7_pin_to_bank(pin);
  3346. void __iomem *pull_sel_reg, *pull_clr_reg;
  3347. pull_sel_reg = pmx->regs[bank] + conf->pupd_reg;
  3348. pull_clr_reg = CLR_REG(pull_sel_reg);
  3349. if (type == PAD_T_4WE_PD || type == PAD_T_4WE_PU) {
  3350. writel(P4WE_PULL_MASK << shift, pull_clr_reg);
  3351. if (sel == PULL_UP)
  3352. writel(P4WE_PULL_UP << shift, pull_sel_reg);
  3353. else if (sel == HIGH_HYSTERESIS)
  3354. writel(P4WE_HIGH_HYSTERESIS << shift, pull_sel_reg);
  3355. else if (sel == HIGH_Z)
  3356. writel(P4WE_HIGH_Z << shift, pull_sel_reg);
  3357. else if (sel == PULL_DOWN)
  3358. writel(P4WE_PULL_DOWN << shift, pull_sel_reg);
  3359. else {
  3360. pr_err("Unknown Pull select type for 4WEPAD#%d\n",
  3361. pin);
  3362. return -ENOTSUPP;
  3363. }
  3364. } else if (type == PAD_T_16ST) {
  3365. writel(P16ST_PULL_MASK << shift, pull_clr_reg);
  3366. if (sel == PULL_UP)
  3367. writel(P16ST_PULL_UP << shift, pull_sel_reg);
  3368. else if (sel == HIGH_Z)
  3369. writel(P16ST_HIGH_Z << shift, pull_sel_reg);
  3370. else if (sel == PULL_DOWN)
  3371. writel(P16ST_PULL_DOWN << shift, pull_sel_reg);
  3372. else {
  3373. pr_err("Unknown Pull select type for 16STPAD#%d\n",
  3374. pin);
  3375. return -ENOTSUPP;
  3376. }
  3377. } else if (type == PAD_T_M31_0204_PD ||
  3378. type == PAD_T_M31_0204_PU ||
  3379. type == PAD_T_M31_0610_PD ||
  3380. type == PAD_T_M31_0610_PU) {
  3381. writel(PM31_PULL_MASK << shift, pull_clr_reg);
  3382. if (sel == PULL_UP)
  3383. writel(PM31_PULL_ENABLED << shift, pull_sel_reg);
  3384. else if (sel == PULL_DOWN)
  3385. writel(PM31_PULL_DISABLED << shift, pull_sel_reg);
  3386. else {
  3387. pr_err("Unknown Pull select type for M31PAD#%d\n",
  3388. pin);
  3389. return -ENOTSUPP;
  3390. }
  3391. } else if (type == PAD_T_AD) {
  3392. writel(PANGD_PULL_MASK << shift, pull_clr_reg);
  3393. if (sel == PULL_UP)
  3394. writel(PANGD_PULL_UP << shift, pull_sel_reg);
  3395. else if (sel == HIGH_Z)
  3396. writel(PANGD_HIGH_Z << shift, pull_sel_reg);
  3397. else if (sel == PULL_DOWN)
  3398. writel(PANGD_PULL_DOWN << shift, pull_sel_reg);
  3399. else {
  3400. pr_err("Unknown Pull select type for A/D PAD#%d\n",
  3401. pin);
  3402. return -ENOTSUPP;
  3403. }
  3404. } else {
  3405. pr_err("Unknown Pad type[%d] for pull select PAD#%d\n",
  3406. type, pin);
  3407. return -ENOTSUPP;
  3408. }
  3409. pr_debug("PIN_CFG ### SET PIN#%d PULL SELECTOR:%d == OK ####\n",
  3410. pin, sel);
  3411. return 0;
  3412. }
  3413. static int __altas7_pinctrl_set_drive_strength_sel(struct pinctrl_dev *pctldev,
  3414. u32 pin, u32 sel)
  3415. {
  3416. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  3417. struct atlas7_pad_config *conf = &pmx->pctl_data->confs[pin];
  3418. u32 type = conf->type;
  3419. u32 shift = conf->drvstr_bit;
  3420. u32 bank = atlas7_pin_to_bank(pin);
  3421. void __iomem *ds_sel_reg, *ds_clr_reg;
  3422. ds_sel_reg = pmx->regs[bank] + conf->drvstr_reg;
  3423. ds_clr_reg = CLR_REG(ds_sel_reg);
  3424. if (type == PAD_T_4WE_PD || type == PAD_T_4WE_PU) {
  3425. if (sel & (~DS_2BIT_MASK))
  3426. goto unsupport;
  3427. writel(DS_2BIT_IM_VAL << shift, ds_clr_reg);
  3428. writel(sel << shift, ds_sel_reg);
  3429. return 0;
  3430. } else if (type == PAD_T_16ST) {
  3431. if (sel & (~DS_4BIT_MASK))
  3432. goto unsupport;
  3433. writel(DS_4BIT_IM_VAL << shift, ds_clr_reg);
  3434. writel(sel << shift, ds_sel_reg);
  3435. return 0;
  3436. } else if (type == PAD_T_M31_0204_PD || type == PAD_T_M31_0204_PU ||
  3437. type == PAD_T_M31_0610_PD || type == PAD_T_M31_0610_PU) {
  3438. if (sel & (~DS_1BIT_MASK))
  3439. goto unsupport;
  3440. writel(DS_1BIT_IM_VAL << shift, ds_clr_reg);
  3441. writel(sel << shift, ds_sel_reg);
  3442. return 0;
  3443. }
  3444. unsupport:
  3445. pr_err("Pad#%d type[%d] doesn't support ds code[%d]!\n",
  3446. pin, type, sel);
  3447. return -ENOTSUPP;
  3448. }
  3449. static int altas7_pinctrl_set_drive_strength_sel(struct pinctrl_dev *pctldev,
  3450. u32 pin, u32 ma)
  3451. {
  3452. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  3453. struct atlas7_pad_config *conf = &pmx->pctl_data->confs[pin];
  3454. u32 type = conf->type;
  3455. u32 sel;
  3456. int ret;
  3457. sel = convert_current_to_drive_strength(conf->type, ma);
  3458. if (DS_NULL == sel) {
  3459. pr_err("Pad#%d type[%d] doesn't support ds current[%d]!\n",
  3460. pin, type, ma);
  3461. return -ENOTSUPP;
  3462. }
  3463. ret = __altas7_pinctrl_set_drive_strength_sel(pctldev,
  3464. pin, sel);
  3465. pr_debug("PIN_CFG ### SET PIN#%d DS:%d MA:%d == %s ####\n",
  3466. pin, sel, ma, ret?"FAILED":"OK");
  3467. return ret;
  3468. }
  3469. static int atlas7_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
  3470. struct pinctrl_gpio_range *range, u32 pin)
  3471. {
  3472. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  3473. u32 idx;
  3474. dev_dbg(pmx->dev,
  3475. "atlas7_pmx_gpio_request_enable: pin=%d\n", pin);
  3476. for (idx = 0; idx < range->npins; idx++) {
  3477. if (pin == range->pins[idx])
  3478. break;
  3479. }
  3480. if (idx >= range->npins) {
  3481. dev_err(pmx->dev,
  3482. "The pin#%d could not be requested as GPIO!!\n",
  3483. pin);
  3484. return -EPERM;
  3485. }
  3486. __atlas7_pmx_pin_enable(pmx, pin, FUNC_GPIO);
  3487. return 0;
  3488. }
  3489. static struct pinmux_ops atlas7_pinmux_ops = {
  3490. .get_functions_count = atlas7_pmx_get_funcs_count,
  3491. .get_function_name = atlas7_pmx_get_func_name,
  3492. .get_function_groups = atlas7_pmx_get_func_groups,
  3493. .set_mux = atlas7_pmx_set_mux,
  3494. .gpio_request_enable = atlas7_pmx_gpio_request_enable,
  3495. };
  3496. static int atlas7_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
  3497. {
  3498. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  3499. return pmx->pctl_data->grps_cnt;
  3500. }
  3501. static const char *atlas7_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
  3502. u32 group)
  3503. {
  3504. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  3505. return pmx->pctl_data->grps[group].name;
  3506. }
  3507. static int atlas7_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
  3508. u32 group, const u32 **pins, u32 *num_pins)
  3509. {
  3510. struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
  3511. *num_pins = pmx->pctl_data->grps[group].num_pins;
  3512. *pins = pmx->pctl_data->grps[group].pins;
  3513. return 0;
  3514. }
  3515. static int atlas7_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
  3516. struct device_node *np_config,
  3517. struct pinctrl_map **map,
  3518. u32 *num_maps)
  3519. {
  3520. return pinconf_generic_dt_node_to_map(pctldev, np_config, map,
  3521. num_maps, PIN_MAP_TYPE_INVALID);
  3522. }
  3523. static void atlas7_pinctrl_dt_free_map(struct pinctrl_dev *pctldev,
  3524. struct pinctrl_map *map, u32 num_maps)
  3525. {
  3526. kfree(map);
  3527. }
  3528. static const struct pinctrl_ops atlas7_pinctrl_ops = {
  3529. .get_groups_count = atlas7_pinctrl_get_groups_count,
  3530. .get_group_name = atlas7_pinctrl_get_group_name,
  3531. .get_group_pins = atlas7_pinctrl_get_group_pins,
  3532. .dt_node_to_map = atlas7_pinctrl_dt_node_to_map,
  3533. .dt_free_map = atlas7_pinctrl_dt_free_map,
  3534. };
  3535. static int atlas7_pin_config_set(struct pinctrl_dev *pctldev,
  3536. unsigned pin, unsigned long *configs,
  3537. unsigned num_configs)
  3538. {
  3539. u16 param, arg;
  3540. int idx, err;
  3541. for (idx = 0; idx < num_configs; idx++) {
  3542. param = pinconf_to_config_param(configs[idx]);
  3543. arg = pinconf_to_config_argument(configs[idx]);
  3544. pr_debug("PMX CFG###### ATLAS7 PIN#%d [%s] CONFIG PARAM:%d ARG:%d >>>>>\n",
  3545. pin, atlas7_ioc_pads[pin].name, param, arg);
  3546. switch (param) {
  3547. case PIN_CONFIG_BIAS_PULL_UP:
  3548. err = altas7_pinctrl_set_pull_sel(pctldev,
  3549. pin, PULL_UP);
  3550. if (err)
  3551. return err;
  3552. break;
  3553. case PIN_CONFIG_BIAS_PULL_DOWN:
  3554. err = altas7_pinctrl_set_pull_sel(pctldev,
  3555. pin, PULL_DOWN);
  3556. if (err)
  3557. return err;
  3558. break;
  3559. case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
  3560. err = altas7_pinctrl_set_pull_sel(pctldev,
  3561. pin, HIGH_HYSTERESIS);
  3562. if (err)
  3563. return err;
  3564. break;
  3565. case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
  3566. err = altas7_pinctrl_set_pull_sel(pctldev,
  3567. pin, HIGH_Z);
  3568. if (err)
  3569. return err;
  3570. break;
  3571. case PIN_CONFIG_DRIVE_STRENGTH:
  3572. err = altas7_pinctrl_set_drive_strength_sel(pctldev,
  3573. pin, arg);
  3574. if (err)
  3575. return err;
  3576. break;
  3577. default:
  3578. return -ENOTSUPP;
  3579. }
  3580. pr_debug("PMX CFG###### ATLAS7 PIN#%d [%s] CONFIG PARAM:%d ARG:%d <<<<\n",
  3581. pin, atlas7_ioc_pads[pin].name, param, arg);
  3582. }
  3583. return 0;
  3584. }
  3585. static int atlas7_pin_config_group_set(struct pinctrl_dev *pctldev,
  3586. unsigned group, unsigned long *configs,
  3587. unsigned num_configs)
  3588. {
  3589. const unsigned *pins;
  3590. unsigned npins;
  3591. int i, ret;
  3592. ret = atlas7_pinctrl_get_group_pins(pctldev, group, &pins, &npins);
  3593. if (ret)
  3594. return ret;
  3595. for (i = 0; i < npins; i++) {
  3596. if (atlas7_pin_config_set(pctldev, pins[i],
  3597. configs, num_configs))
  3598. return -ENOTSUPP;
  3599. }
  3600. return 0;
  3601. }
  3602. static const struct pinconf_ops atlas7_pinconf_ops = {
  3603. .pin_config_set = atlas7_pin_config_set,
  3604. .pin_config_group_set = atlas7_pin_config_group_set,
  3605. .is_generic = true,
  3606. };
  3607. static int atlas7_pinmux_probe(struct platform_device *pdev)
  3608. {
  3609. int ret, idx;
  3610. struct atlas7_pmx *pmx;
  3611. struct device_node *np = pdev->dev.of_node;
  3612. u32 banks = ATLAS7_PINCTRL_REG_BANKS;
  3613. /* Create state holders etc for this driver */
  3614. pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
  3615. if (!pmx)
  3616. return -ENOMEM;
  3617. pmx->dev = &pdev->dev;
  3618. pmx->pctl_data = &atlas7_ioc_data;
  3619. pmx->pctl_desc.name = "pinctrl-atlas7";
  3620. pmx->pctl_desc.pins = pmx->pctl_data->pads;
  3621. pmx->pctl_desc.npins = pmx->pctl_data->pads_cnt;
  3622. pmx->pctl_desc.pctlops = &atlas7_pinctrl_ops;
  3623. pmx->pctl_desc.pmxops = &atlas7_pinmux_ops;
  3624. pmx->pctl_desc.confops = &atlas7_pinconf_ops;
  3625. for (idx = 0; idx < banks; idx++) {
  3626. pmx->regs[idx] = of_iomap(np, idx);
  3627. if (!pmx->regs[idx]) {
  3628. dev_err(&pdev->dev,
  3629. "can't map ioc bank#%d registers\n", idx);
  3630. ret = -ENOMEM;
  3631. goto unmap_io;
  3632. }
  3633. }
  3634. /* Now register the pin controller and all pins it handles */
  3635. pmx->pctl = pinctrl_register(&pmx->pctl_desc, &pdev->dev, pmx);
  3636. if (IS_ERR(pmx->pctl)) {
  3637. dev_err(&pdev->dev, "could not register atlas7 pinmux driver\n");
  3638. ret = PTR_ERR(pmx->pctl);
  3639. goto unmap_io;
  3640. }
  3641. platform_set_drvdata(pdev, pmx);
  3642. dev_info(&pdev->dev, "initialized atlas7 pinmux driver\n");
  3643. return 0;
  3644. unmap_io:
  3645. for (idx = 0; idx < banks; idx++) {
  3646. if (!pmx->regs[idx])
  3647. break;
  3648. iounmap(pmx->regs[idx]);
  3649. }
  3650. return ret;
  3651. }
  3652. static const struct of_device_id atlas7_pinmux_ids[] = {
  3653. { .compatible = "sirf,atlas7-ioc",},
  3654. };
  3655. static struct platform_driver atlas7_pinmux_driver = {
  3656. .driver = {
  3657. .name = "atlas7-ioc",
  3658. .of_match_table = atlas7_pinmux_ids,
  3659. },
  3660. .probe = atlas7_pinmux_probe,
  3661. };
  3662. static int __init atlas7_pinmux_init(void)
  3663. {
  3664. return platform_driver_register(&atlas7_pinmux_driver);
  3665. }
  3666. arch_initcall(atlas7_pinmux_init);
  3667. /**
  3668. * The Following is GPIO Code
  3669. */
  3670. static inline struct
  3671. atlas7_gpio_bank *atlas7_gpio_to_bank(struct atlas7_gpio_chip *a7gc, u32 gpio)
  3672. {
  3673. return &a7gc->banks[GPIO_TO_BANK(gpio)];
  3674. }
  3675. static int __atlas7_gpio_to_pin(struct atlas7_gpio_chip *a7gc, u32 gpio)
  3676. {
  3677. struct atlas7_gpio_bank *bank;
  3678. u32 ofs;
  3679. bank = atlas7_gpio_to_bank(a7gc, gpio);
  3680. ofs = gpio - bank->gpio_offset;
  3681. if (ofs >= bank->ngpio)
  3682. return -ENODEV;
  3683. return bank->gpio_pins[ofs];
  3684. }
  3685. static void atlas7_gpio_irq_ack(struct irq_data *d)
  3686. {
  3687. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  3688. struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc);
  3689. struct atlas7_gpio_bank *bank;
  3690. void __iomem *ctrl_reg;
  3691. u32 val, pin_in_bank;
  3692. unsigned long flags;
  3693. bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
  3694. pin_in_bank = d->hwirq - bank->gpio_offset;
  3695. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  3696. spin_lock_irqsave(&a7gc->lock, flags);
  3697. val = readl(ctrl_reg);
  3698. /* clear interrupt status */
  3699. writel(val, ctrl_reg);
  3700. spin_unlock_irqrestore(&a7gc->lock, flags);
  3701. }
  3702. static void __atlas7_gpio_irq_mask(struct atlas7_gpio_chip *a7gc, int idx)
  3703. {
  3704. struct atlas7_gpio_bank *bank;
  3705. void __iomem *ctrl_reg;
  3706. u32 val, pin_in_bank;
  3707. bank = atlas7_gpio_to_bank(a7gc, idx);
  3708. pin_in_bank = idx - bank->gpio_offset;
  3709. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  3710. val = readl(ctrl_reg);
  3711. val &= ~(ATLAS7_GPIO_CTL_INTR_EN_MASK |
  3712. ATLAS7_GPIO_CTL_INTR_STATUS_MASK);
  3713. writel(val, ctrl_reg);
  3714. }
  3715. static void atlas7_gpio_irq_mask(struct irq_data *d)
  3716. {
  3717. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  3718. struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc);
  3719. unsigned long flags;
  3720. spin_lock_irqsave(&a7gc->lock, flags);
  3721. __atlas7_gpio_irq_mask(a7gc, d->hwirq);
  3722. spin_unlock_irqrestore(&a7gc->lock, flags);
  3723. }
  3724. static void atlas7_gpio_irq_unmask(struct irq_data *d)
  3725. {
  3726. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  3727. struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc);
  3728. struct atlas7_gpio_bank *bank;
  3729. void __iomem *ctrl_reg;
  3730. u32 val, pin_in_bank;
  3731. unsigned long flags;
  3732. bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
  3733. pin_in_bank = d->hwirq - bank->gpio_offset;
  3734. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  3735. spin_lock_irqsave(&a7gc->lock, flags);
  3736. val = readl(ctrl_reg);
  3737. val &= ~ATLAS7_GPIO_CTL_INTR_STATUS_MASK;
  3738. val |= ATLAS7_GPIO_CTL_INTR_EN_MASK;
  3739. writel(val, ctrl_reg);
  3740. spin_unlock_irqrestore(&a7gc->lock, flags);
  3741. }
  3742. static int atlas7_gpio_irq_type(struct irq_data *d,
  3743. unsigned int type)
  3744. {
  3745. struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
  3746. struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc);
  3747. struct atlas7_gpio_bank *bank;
  3748. void __iomem *ctrl_reg;
  3749. u32 val, pin_in_bank;
  3750. unsigned long flags;
  3751. bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
  3752. pin_in_bank = d->hwirq - bank->gpio_offset;
  3753. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  3754. spin_lock_irqsave(&a7gc->lock, flags);
  3755. val = readl(ctrl_reg);
  3756. val &= ~(ATLAS7_GPIO_CTL_INTR_STATUS_MASK |
  3757. ATLAS7_GPIO_CTL_INTR_EN_MASK);
  3758. switch (type) {
  3759. case IRQ_TYPE_NONE:
  3760. break;
  3761. case IRQ_TYPE_EDGE_RISING:
  3762. val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
  3763. ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
  3764. val &= ~ATLAS7_GPIO_CTL_INTR_LOW_MASK;
  3765. break;
  3766. case IRQ_TYPE_EDGE_FALLING:
  3767. val &= ~ATLAS7_GPIO_CTL_INTR_HIGH_MASK;
  3768. val |= ATLAS7_GPIO_CTL_INTR_LOW_MASK |
  3769. ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
  3770. break;
  3771. case IRQ_TYPE_EDGE_BOTH:
  3772. val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
  3773. ATLAS7_GPIO_CTL_INTR_LOW_MASK |
  3774. ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
  3775. break;
  3776. case IRQ_TYPE_LEVEL_LOW:
  3777. val &= ~(ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
  3778. ATLAS7_GPIO_CTL_INTR_TYPE_MASK);
  3779. val |= ATLAS7_GPIO_CTL_INTR_LOW_MASK;
  3780. break;
  3781. case IRQ_TYPE_LEVEL_HIGH:
  3782. val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK;
  3783. val &= ~(ATLAS7_GPIO_CTL_INTR_LOW_MASK |
  3784. ATLAS7_GPIO_CTL_INTR_TYPE_MASK);
  3785. break;
  3786. }
  3787. writel(val, ctrl_reg);
  3788. spin_unlock_irqrestore(&a7gc->lock, flags);
  3789. return 0;
  3790. }
  3791. static struct irq_chip atlas7_gpio_irq_chip = {
  3792. .name = "atlas7-gpio-irq",
  3793. .irq_ack = atlas7_gpio_irq_ack,
  3794. .irq_mask = atlas7_gpio_irq_mask,
  3795. .irq_unmask = atlas7_gpio_irq_unmask,
  3796. .irq_set_type = atlas7_gpio_irq_type,
  3797. };
  3798. static void atlas7_gpio_handle_irq(unsigned int irq, struct irq_desc *desc)
  3799. {
  3800. struct gpio_chip *gc = irq_desc_get_handler_data(desc);
  3801. struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc);
  3802. struct atlas7_gpio_bank *bank = NULL;
  3803. u32 status, ctrl;
  3804. int pin_in_bank = 0, idx;
  3805. struct irq_chip *chip = irq_get_chip(irq);
  3806. for (idx = 0; idx < a7gc->nbank; idx++) {
  3807. bank = &a7gc->banks[idx];
  3808. if (bank->irq == irq)
  3809. break;
  3810. }
  3811. BUG_ON(idx == a7gc->nbank);
  3812. chained_irq_enter(chip, desc);
  3813. status = readl(ATLAS7_GPIO_INT_STATUS(bank));
  3814. if (!status) {
  3815. pr_warn("%s: gpio [%s] status %#x no interrupt is flaged\n",
  3816. __func__, gc->label, status);
  3817. handle_bad_irq(irq, desc);
  3818. return;
  3819. }
  3820. while (status) {
  3821. ctrl = readl(ATLAS7_GPIO_CTRL(bank, pin_in_bank));
  3822. /*
  3823. * Here we must check whether the corresponding GPIO's
  3824. * interrupt has been enabled, otherwise just skip it
  3825. */
  3826. if ((status & 0x1) && (ctrl & ATLAS7_GPIO_CTL_INTR_EN_MASK)) {
  3827. pr_debug("%s: chip[%s] gpio:%d happens\n",
  3828. __func__, gc->label,
  3829. bank->gpio_offset + pin_in_bank);
  3830. generic_handle_irq(
  3831. irq_find_mapping(gc->irqdomain,
  3832. bank->gpio_offset + pin_in_bank));
  3833. }
  3834. if (++pin_in_bank >= bank->ngpio)
  3835. break;
  3836. status = status >> 1;
  3837. }
  3838. chained_irq_exit(chip, desc);
  3839. }
  3840. static void __atlas7_gpio_set_input(struct atlas7_gpio_chip *a7gc,
  3841. unsigned int gpio)
  3842. {
  3843. struct atlas7_gpio_bank *bank;
  3844. void __iomem *ctrl_reg;
  3845. u32 val, pin_in_bank;
  3846. bank = atlas7_gpio_to_bank(a7gc, gpio);
  3847. pin_in_bank = gpio - bank->gpio_offset;
  3848. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  3849. val = readl(ctrl_reg);
  3850. val &= ~ATLAS7_GPIO_CTL_OUT_EN_MASK;
  3851. writel(val, ctrl_reg);
  3852. }
  3853. static int atlas7_gpio_request(struct gpio_chip *chip,
  3854. unsigned int gpio)
  3855. {
  3856. struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
  3857. int ret;
  3858. unsigned long flags;
  3859. ret = __atlas7_gpio_to_pin(a7gc, gpio);
  3860. if (ret < 0)
  3861. return ret;
  3862. if (pinctrl_request_gpio(chip->base + gpio))
  3863. return -ENODEV;
  3864. spin_lock_irqsave(&a7gc->lock, flags);
  3865. /*
  3866. * default status:
  3867. * set direction as input and mask irq
  3868. */
  3869. __atlas7_gpio_set_input(a7gc, gpio);
  3870. __atlas7_gpio_irq_mask(a7gc, gpio);
  3871. spin_unlock_irqrestore(&a7gc->lock, flags);
  3872. return 0;
  3873. }
  3874. static void atlas7_gpio_free(struct gpio_chip *chip,
  3875. unsigned int gpio)
  3876. {
  3877. struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
  3878. unsigned long flags;
  3879. spin_lock_irqsave(&a7gc->lock, flags);
  3880. __atlas7_gpio_irq_mask(a7gc, gpio);
  3881. __atlas7_gpio_set_input(a7gc, gpio);
  3882. spin_unlock_irqrestore(&a7gc->lock, flags);
  3883. pinctrl_free_gpio(chip->base + gpio);
  3884. }
  3885. static int atlas7_gpio_direction_input(struct gpio_chip *chip,
  3886. unsigned int gpio)
  3887. {
  3888. struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
  3889. unsigned long flags;
  3890. spin_lock_irqsave(&a7gc->lock, flags);
  3891. __atlas7_gpio_set_input(a7gc, gpio);
  3892. spin_unlock_irqrestore(&a7gc->lock, flags);
  3893. return 0;
  3894. }
  3895. static void __atlas7_gpio_set_output(struct atlas7_gpio_chip *a7gc,
  3896. unsigned int gpio, int value)
  3897. {
  3898. struct atlas7_gpio_bank *bank;
  3899. void __iomem *ctrl_reg;
  3900. u32 out_ctrl, pin_in_bank;
  3901. bank = atlas7_gpio_to_bank(a7gc, gpio);
  3902. pin_in_bank = gpio - bank->gpio_offset;
  3903. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  3904. out_ctrl = readl(ctrl_reg);
  3905. if (value)
  3906. out_ctrl |= ATLAS7_GPIO_CTL_DATAOUT_MASK;
  3907. else
  3908. out_ctrl &= ~ATLAS7_GPIO_CTL_DATAOUT_MASK;
  3909. out_ctrl &= ~ATLAS7_GPIO_CTL_INTR_EN_MASK;
  3910. out_ctrl |= ATLAS7_GPIO_CTL_OUT_EN_MASK;
  3911. writel(out_ctrl, ctrl_reg);
  3912. }
  3913. static int atlas7_gpio_direction_output(struct gpio_chip *chip,
  3914. unsigned int gpio, int value)
  3915. {
  3916. struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
  3917. unsigned long flags;
  3918. spin_lock_irqsave(&a7gc->lock, flags);
  3919. __atlas7_gpio_set_output(a7gc, gpio, value);
  3920. spin_unlock_irqrestore(&a7gc->lock, flags);
  3921. return 0;
  3922. }
  3923. static int atlas7_gpio_get_value(struct gpio_chip *chip,
  3924. unsigned int gpio)
  3925. {
  3926. struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
  3927. struct atlas7_gpio_bank *bank;
  3928. u32 val, pin_in_bank;
  3929. unsigned long flags;
  3930. bank = atlas7_gpio_to_bank(a7gc, gpio);
  3931. pin_in_bank = gpio - bank->gpio_offset;
  3932. spin_lock_irqsave(&a7gc->lock, flags);
  3933. val = readl(ATLAS7_GPIO_CTRL(bank, pin_in_bank));
  3934. spin_unlock_irqrestore(&a7gc->lock, flags);
  3935. return !!(val & ATLAS7_GPIO_CTL_DATAIN_MASK);
  3936. }
  3937. static void atlas7_gpio_set_value(struct gpio_chip *chip,
  3938. unsigned int gpio, int value)
  3939. {
  3940. struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
  3941. struct atlas7_gpio_bank *bank;
  3942. void __iomem *ctrl_reg;
  3943. u32 ctrl, pin_in_bank;
  3944. unsigned long flags;
  3945. bank = atlas7_gpio_to_bank(a7gc, gpio);
  3946. pin_in_bank = gpio - bank->gpio_offset;
  3947. ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);
  3948. spin_lock_irqsave(&a7gc->lock, flags);
  3949. ctrl = readl(ctrl_reg);
  3950. if (value)
  3951. ctrl |= ATLAS7_GPIO_CTL_DATAOUT_MASK;
  3952. else
  3953. ctrl &= ~ATLAS7_GPIO_CTL_DATAOUT_MASK;
  3954. writel(ctrl, ctrl_reg);
  3955. spin_unlock_irqrestore(&a7gc->lock, flags);
  3956. }
  3957. static const struct of_device_id atlas7_gpio_ids[] = {
  3958. { .compatible = "sirf,atlas7-gpio", },
  3959. };
  3960. static int atlas7_gpio_probe(struct platform_device *pdev)
  3961. {
  3962. struct device_node *np = pdev->dev.of_node;
  3963. struct atlas7_gpio_chip *a7gc;
  3964. struct gpio_chip *chip;
  3965. u32 nbank;
  3966. int ret, idx;
  3967. ret = of_property_read_u32(np, "gpio-banks", &nbank);
  3968. if (ret) {
  3969. dev_err(&pdev->dev,
  3970. "Could not find GPIO bank info,ret=%d!\n",
  3971. ret);
  3972. return ret;
  3973. }
  3974. /* retrieve gpio descriptor data */
  3975. a7gc = devm_kzalloc(&pdev->dev, sizeof(*a7gc) +
  3976. sizeof(struct atlas7_gpio_bank) * nbank, GFP_KERNEL);
  3977. if (!a7gc)
  3978. return -ENOMEM;
  3979. /* Get Gpio clk */
  3980. a7gc->clk = of_clk_get(np, 0);
  3981. if (!IS_ERR(a7gc->clk)) {
  3982. ret = clk_prepare_enable(a7gc->clk);
  3983. if (ret) {
  3984. dev_err(&pdev->dev,
  3985. "Could not enable clock!\n");
  3986. return ret;
  3987. }
  3988. }
  3989. /* Get Gpio Registers */
  3990. a7gc->reg = of_iomap(np, 0);
  3991. if (!a7gc->reg) {
  3992. dev_err(&pdev->dev, "Could not map GPIO Registers!\n");
  3993. return -ENOMEM;
  3994. }
  3995. a7gc->nbank = nbank;
  3996. spin_lock_init(&a7gc->lock);
  3997. /* Setup GPIO Chip */
  3998. chip = &a7gc->chip;
  3999. chip->request = atlas7_gpio_request;
  4000. chip->free = atlas7_gpio_free;
  4001. chip->direction_input = atlas7_gpio_direction_input;
  4002. chip->get = atlas7_gpio_get_value;
  4003. chip->direction_output = atlas7_gpio_direction_output;
  4004. chip->set = atlas7_gpio_set_value;
  4005. chip->base = -1;
  4006. /* Each chip can support 32 pins at one bank */
  4007. chip->ngpio = NGPIO_OF_BANK * nbank;
  4008. chip->label = kstrdup(np->name, GFP_KERNEL);
  4009. chip->of_node = np;
  4010. chip->of_gpio_n_cells = 2;
  4011. chip->dev = &pdev->dev;
  4012. /* Add gpio chip to system */
  4013. ret = gpiochip_add(chip);
  4014. if (ret) {
  4015. dev_err(&pdev->dev,
  4016. "%s: error in probe function with status %d\n",
  4017. np->name, ret);
  4018. goto failed;
  4019. }
  4020. /* Add gpio chip to irq subsystem */
  4021. ret = gpiochip_irqchip_add(chip, &atlas7_gpio_irq_chip,
  4022. 0, handle_level_irq, IRQ_TYPE_NONE);
  4023. if (ret) {
  4024. dev_err(&pdev->dev,
  4025. "could not connect irqchip to gpiochip\n");
  4026. goto failed;
  4027. }
  4028. for (idx = 0; idx < nbank; idx++) {
  4029. struct gpio_pin_range *pin_range;
  4030. struct atlas7_gpio_bank *bank;
  4031. bank = &a7gc->banks[idx];
  4032. /* Set ctrl registers' base of this bank */
  4033. bank->base = ATLAS7_GPIO_BASE(a7gc, idx);
  4034. /* Get interrupt number from DTS */
  4035. ret = of_irq_get(np, idx);
  4036. if (ret == -EPROBE_DEFER) {
  4037. dev_err(&pdev->dev,
  4038. "Unable to find IRQ number. ret=%d\n", ret);
  4039. goto failed;
  4040. }
  4041. bank->irq = ret;
  4042. gpiochip_set_chained_irqchip(chip, &atlas7_gpio_irq_chip,
  4043. bank->irq, atlas7_gpio_handle_irq);
  4044. /* Records gpio_pin_range to a7gc */
  4045. list_for_each_entry(pin_range, &chip->pin_ranges, node) {
  4046. struct pinctrl_gpio_range *range;
  4047. range = &pin_range->range;
  4048. if (range->id == NGPIO_OF_BANK * idx) {
  4049. bank->gpio_offset = range->id;
  4050. bank->ngpio = range->npins;
  4051. bank->gpio_pins = range->pins;
  4052. bank->pctldev = pin_range->pctldev;
  4053. break;
  4054. }
  4055. }
  4056. BUG_ON(!bank->pctldev);
  4057. }
  4058. dev_info(&pdev->dev, "add to system.\n");
  4059. return 0;
  4060. failed:
  4061. return ret;
  4062. }
  4063. static struct platform_driver atlas7_gpio_driver = {
  4064. .driver = {
  4065. .name = "atlas7-gpio",
  4066. .owner = THIS_MODULE,
  4067. .of_match_table = atlas7_gpio_ids,
  4068. },
  4069. .probe = atlas7_gpio_probe,
  4070. };
  4071. static int __init atlas7_gpio_init(void)
  4072. {
  4073. return platform_driver_register(&atlas7_gpio_driver);
  4074. }
  4075. subsys_initcall(atlas7_gpio_init);
  4076. MODULE_DESCRIPTION("SIRFSOC Atlas7 pin control driver");
  4077. MODULE_LICENSE("GPL");