pinctrl-atlas7.c 198 KB

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