clk-exynos5433.c 209 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415
  1. /*
  2. * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  3. * Author: Chanwoo Choi <cw00.choi@samsung.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Common Clock Framework support for Exynos5433 SoC.
  10. */
  11. #include <linux/clk-provider.h>
  12. #include <linux/of.h>
  13. #include <linux/of_address.h>
  14. #include <dt-bindings/clock/exynos5433.h>
  15. #include "clk.h"
  16. #include "clk-cpu.h"
  17. #include "clk-pll.h"
  18. /*
  19. * Register offset definitions for CMU_TOP
  20. */
  21. #define ISP_PLL_LOCK 0x0000
  22. #define AUD_PLL_LOCK 0x0004
  23. #define ISP_PLL_CON0 0x0100
  24. #define ISP_PLL_CON1 0x0104
  25. #define ISP_PLL_FREQ_DET 0x0108
  26. #define AUD_PLL_CON0 0x0110
  27. #define AUD_PLL_CON1 0x0114
  28. #define AUD_PLL_CON2 0x0118
  29. #define AUD_PLL_FREQ_DET 0x011c
  30. #define MUX_SEL_TOP0 0x0200
  31. #define MUX_SEL_TOP1 0x0204
  32. #define MUX_SEL_TOP2 0x0208
  33. #define MUX_SEL_TOP3 0x020c
  34. #define MUX_SEL_TOP4 0x0210
  35. #define MUX_SEL_TOP_MSCL 0x0220
  36. #define MUX_SEL_TOP_CAM1 0x0224
  37. #define MUX_SEL_TOP_DISP 0x0228
  38. #define MUX_SEL_TOP_FSYS0 0x0230
  39. #define MUX_SEL_TOP_FSYS1 0x0234
  40. #define MUX_SEL_TOP_PERIC0 0x0238
  41. #define MUX_SEL_TOP_PERIC1 0x023c
  42. #define MUX_ENABLE_TOP0 0x0300
  43. #define MUX_ENABLE_TOP1 0x0304
  44. #define MUX_ENABLE_TOP2 0x0308
  45. #define MUX_ENABLE_TOP3 0x030c
  46. #define MUX_ENABLE_TOP4 0x0310
  47. #define MUX_ENABLE_TOP_MSCL 0x0320
  48. #define MUX_ENABLE_TOP_CAM1 0x0324
  49. #define MUX_ENABLE_TOP_DISP 0x0328
  50. #define MUX_ENABLE_TOP_FSYS0 0x0330
  51. #define MUX_ENABLE_TOP_FSYS1 0x0334
  52. #define MUX_ENABLE_TOP_PERIC0 0x0338
  53. #define MUX_ENABLE_TOP_PERIC1 0x033c
  54. #define MUX_STAT_TOP0 0x0400
  55. #define MUX_STAT_TOP1 0x0404
  56. #define MUX_STAT_TOP2 0x0408
  57. #define MUX_STAT_TOP3 0x040c
  58. #define MUX_STAT_TOP4 0x0410
  59. #define MUX_STAT_TOP_MSCL 0x0420
  60. #define MUX_STAT_TOP_CAM1 0x0424
  61. #define MUX_STAT_TOP_FSYS0 0x0430
  62. #define MUX_STAT_TOP_FSYS1 0x0434
  63. #define MUX_STAT_TOP_PERIC0 0x0438
  64. #define MUX_STAT_TOP_PERIC1 0x043c
  65. #define DIV_TOP0 0x0600
  66. #define DIV_TOP1 0x0604
  67. #define DIV_TOP2 0x0608
  68. #define DIV_TOP3 0x060c
  69. #define DIV_TOP4 0x0610
  70. #define DIV_TOP_MSCL 0x0618
  71. #define DIV_TOP_CAM10 0x061c
  72. #define DIV_TOP_CAM11 0x0620
  73. #define DIV_TOP_FSYS0 0x062c
  74. #define DIV_TOP_FSYS1 0x0630
  75. #define DIV_TOP_FSYS2 0x0634
  76. #define DIV_TOP_PERIC0 0x0638
  77. #define DIV_TOP_PERIC1 0x063c
  78. #define DIV_TOP_PERIC2 0x0640
  79. #define DIV_TOP_PERIC3 0x0644
  80. #define DIV_TOP_PERIC4 0x0648
  81. #define DIV_TOP_PLL_FREQ_DET 0x064c
  82. #define DIV_STAT_TOP0 0x0700
  83. #define DIV_STAT_TOP1 0x0704
  84. #define DIV_STAT_TOP2 0x0708
  85. #define DIV_STAT_TOP3 0x070c
  86. #define DIV_STAT_TOP4 0x0710
  87. #define DIV_STAT_TOP_MSCL 0x0718
  88. #define DIV_STAT_TOP_CAM10 0x071c
  89. #define DIV_STAT_TOP_CAM11 0x0720
  90. #define DIV_STAT_TOP_FSYS0 0x072c
  91. #define DIV_STAT_TOP_FSYS1 0x0730
  92. #define DIV_STAT_TOP_FSYS2 0x0734
  93. #define DIV_STAT_TOP_PERIC0 0x0738
  94. #define DIV_STAT_TOP_PERIC1 0x073c
  95. #define DIV_STAT_TOP_PERIC2 0x0740
  96. #define DIV_STAT_TOP_PERIC3 0x0744
  97. #define DIV_STAT_TOP_PLL_FREQ_DET 0x074c
  98. #define ENABLE_ACLK_TOP 0x0800
  99. #define ENABLE_SCLK_TOP 0x0a00
  100. #define ENABLE_SCLK_TOP_MSCL 0x0a04
  101. #define ENABLE_SCLK_TOP_CAM1 0x0a08
  102. #define ENABLE_SCLK_TOP_DISP 0x0a0c
  103. #define ENABLE_SCLK_TOP_FSYS 0x0a10
  104. #define ENABLE_SCLK_TOP_PERIC 0x0a14
  105. #define ENABLE_IP_TOP 0x0b00
  106. #define ENABLE_CMU_TOP 0x0c00
  107. #define ENABLE_CMU_TOP_DIV_STAT 0x0c04
  108. static const unsigned long top_clk_regs[] __initconst = {
  109. ISP_PLL_LOCK,
  110. AUD_PLL_LOCK,
  111. ISP_PLL_CON0,
  112. ISP_PLL_CON1,
  113. ISP_PLL_FREQ_DET,
  114. AUD_PLL_CON0,
  115. AUD_PLL_CON1,
  116. AUD_PLL_CON2,
  117. AUD_PLL_FREQ_DET,
  118. MUX_SEL_TOP0,
  119. MUX_SEL_TOP1,
  120. MUX_SEL_TOP2,
  121. MUX_SEL_TOP3,
  122. MUX_SEL_TOP4,
  123. MUX_SEL_TOP_MSCL,
  124. MUX_SEL_TOP_CAM1,
  125. MUX_SEL_TOP_DISP,
  126. MUX_SEL_TOP_FSYS0,
  127. MUX_SEL_TOP_FSYS1,
  128. MUX_SEL_TOP_PERIC0,
  129. MUX_SEL_TOP_PERIC1,
  130. MUX_ENABLE_TOP0,
  131. MUX_ENABLE_TOP1,
  132. MUX_ENABLE_TOP2,
  133. MUX_ENABLE_TOP3,
  134. MUX_ENABLE_TOP4,
  135. MUX_ENABLE_TOP_MSCL,
  136. MUX_ENABLE_TOP_CAM1,
  137. MUX_ENABLE_TOP_DISP,
  138. MUX_ENABLE_TOP_FSYS0,
  139. MUX_ENABLE_TOP_FSYS1,
  140. MUX_ENABLE_TOP_PERIC0,
  141. MUX_ENABLE_TOP_PERIC1,
  142. DIV_TOP0,
  143. DIV_TOP1,
  144. DIV_TOP2,
  145. DIV_TOP3,
  146. DIV_TOP4,
  147. DIV_TOP_MSCL,
  148. DIV_TOP_CAM10,
  149. DIV_TOP_CAM11,
  150. DIV_TOP_FSYS0,
  151. DIV_TOP_FSYS1,
  152. DIV_TOP_FSYS2,
  153. DIV_TOP_PERIC0,
  154. DIV_TOP_PERIC1,
  155. DIV_TOP_PERIC2,
  156. DIV_TOP_PERIC3,
  157. DIV_TOP_PERIC4,
  158. DIV_TOP_PLL_FREQ_DET,
  159. ENABLE_ACLK_TOP,
  160. ENABLE_SCLK_TOP,
  161. ENABLE_SCLK_TOP_MSCL,
  162. ENABLE_SCLK_TOP_CAM1,
  163. ENABLE_SCLK_TOP_DISP,
  164. ENABLE_SCLK_TOP_FSYS,
  165. ENABLE_SCLK_TOP_PERIC,
  166. ENABLE_IP_TOP,
  167. ENABLE_CMU_TOP,
  168. ENABLE_CMU_TOP_DIV_STAT,
  169. };
  170. /* list of all parent clock list */
  171. PNAME(mout_aud_pll_p) = { "oscclk", "fout_aud_pll", };
  172. PNAME(mout_isp_pll_p) = { "oscclk", "fout_isp_pll", };
  173. PNAME(mout_aud_pll_user_p) = { "oscclk", "mout_aud_pll", };
  174. PNAME(mout_mphy_pll_user_p) = { "oscclk", "sclk_mphy_pll", };
  175. PNAME(mout_mfc_pll_user_p) = { "oscclk", "sclk_mfc_pll", };
  176. PNAME(mout_bus_pll_user_p) = { "oscclk", "sclk_bus_pll", };
  177. PNAME(mout_bus_pll_user_t_p) = { "oscclk", "mout_bus_pll_user", };
  178. PNAME(mout_mphy_pll_user_t_p) = { "oscclk", "mout_mphy_pll_user", };
  179. PNAME(mout_bus_mfc_pll_user_p) = { "mout_bus_pll_user", "mout_mfc_pll_user",};
  180. PNAME(mout_mfc_bus_pll_user_p) = { "mout_mfc_pll_user", "mout_bus_pll_user",};
  181. PNAME(mout_aclk_cam1_552_b_p) = { "mout_aclk_cam1_552_a",
  182. "mout_mfc_pll_user", };
  183. PNAME(mout_aclk_cam1_552_a_p) = { "mout_isp_pll", "mout_bus_pll_user", };
  184. PNAME(mout_aclk_mfc_400_c_p) = { "mout_aclk_mfc_400_b",
  185. "mout_mphy_pll_user", };
  186. PNAME(mout_aclk_mfc_400_b_p) = { "mout_aclk_mfc_400_a",
  187. "mout_bus_pll_user", };
  188. PNAME(mout_aclk_mfc_400_a_p) = { "mout_mfc_pll_user", "mout_isp_pll", };
  189. PNAME(mout_bus_mphy_pll_user_p) = { "mout_bus_pll_user",
  190. "mout_mphy_pll_user", };
  191. PNAME(mout_aclk_mscl_b_p) = { "mout_aclk_mscl_400_a",
  192. "mout_mphy_pll_user", };
  193. PNAME(mout_aclk_g2d_400_b_p) = { "mout_aclk_g2d_400_a",
  194. "mout_mphy_pll_user", };
  195. PNAME(mout_sclk_jpeg_c_p) = { "mout_sclk_jpeg_b", "mout_mphy_pll_user",};
  196. PNAME(mout_sclk_jpeg_b_p) = { "mout_sclk_jpeg_a", "mout_mfc_pll_user", };
  197. PNAME(mout_sclk_mmc2_b_p) = { "mout_sclk_mmc2_a", "mout_mfc_pll_user",};
  198. PNAME(mout_sclk_mmc1_b_p) = { "mout_sclk_mmc1_a", "mout_mfc_pll_user",};
  199. PNAME(mout_sclk_mmc0_d_p) = { "mout_sclk_mmc0_c", "mout_isp_pll", };
  200. PNAME(mout_sclk_mmc0_c_p) = { "mout_sclk_mmc0_b", "mout_mphy_pll_user",};
  201. PNAME(mout_sclk_mmc0_b_p) = { "mout_sclk_mmc0_a", "mout_mfc_pll_user", };
  202. PNAME(mout_sclk_spdif_p) = { "sclk_audio0", "sclk_audio1",
  203. "oscclk", "ioclk_spdif_extclk", };
  204. PNAME(mout_sclk_audio1_p) = { "ioclk_audiocdclk1", "oscclk",
  205. "mout_aud_pll_user_t",};
  206. PNAME(mout_sclk_audio0_p) = { "ioclk_audiocdclk0", "oscclk",
  207. "mout_aud_pll_user_t",};
  208. PNAME(mout_sclk_hdmi_spdif_p) = { "sclk_audio1", "ioclk_spdif_extclk", };
  209. static const struct samsung_fixed_factor_clock top_fixed_factor_clks[] __initconst = {
  210. FFACTOR(0, "oscclk_efuse_common", "oscclk", 1, 1, 0),
  211. };
  212. static const struct samsung_fixed_rate_clock top_fixed_clks[] __initconst = {
  213. /* Xi2s{0|1}CDCLK input clock for I2S/PCM */
  214. FRATE(0, "ioclk_audiocdclk1", NULL, 0, 100000000),
  215. FRATE(0, "ioclk_audiocdclk0", NULL, 0, 100000000),
  216. /* Xi2s1SDI input clock for SPDIF */
  217. FRATE(0, "ioclk_spdif_extclk", NULL, 0, 100000000),
  218. /* XspiCLK[4:0] input clock for SPI */
  219. FRATE(0, "ioclk_spi4_clk_in", NULL, 0, 50000000),
  220. FRATE(0, "ioclk_spi3_clk_in", NULL, 0, 50000000),
  221. FRATE(0, "ioclk_spi2_clk_in", NULL, 0, 50000000),
  222. FRATE(0, "ioclk_spi1_clk_in", NULL, 0, 50000000),
  223. FRATE(0, "ioclk_spi0_clk_in", NULL, 0, 50000000),
  224. /* Xi2s1SCLK input clock for I2S1_BCLK */
  225. FRATE(0, "ioclk_i2s1_bclk_in", NULL, 0, 12288000),
  226. };
  227. static const struct samsung_mux_clock top_mux_clks[] __initconst = {
  228. /* MUX_SEL_TOP0 */
  229. MUX(CLK_MOUT_AUD_PLL, "mout_aud_pll", mout_aud_pll_p, MUX_SEL_TOP0,
  230. 4, 1),
  231. MUX(CLK_MOUT_ISP_PLL, "mout_isp_pll", mout_isp_pll_p, MUX_SEL_TOP0,
  232. 0, 1),
  233. /* MUX_SEL_TOP1 */
  234. MUX(CLK_MOUT_AUD_PLL_USER_T, "mout_aud_pll_user_t",
  235. mout_aud_pll_user_p, MUX_SEL_TOP1, 12, 1),
  236. MUX(CLK_MOUT_MPHY_PLL_USER, "mout_mphy_pll_user", mout_mphy_pll_user_p,
  237. MUX_SEL_TOP1, 8, 1),
  238. MUX(CLK_MOUT_MFC_PLL_USER, "mout_mfc_pll_user", mout_mfc_pll_user_p,
  239. MUX_SEL_TOP1, 4, 1),
  240. MUX(CLK_MOUT_BUS_PLL_USER, "mout_bus_pll_user", mout_bus_pll_user_p,
  241. MUX_SEL_TOP1, 0, 1),
  242. /* MUX_SEL_TOP2 */
  243. MUX(CLK_MOUT_ACLK_HEVC_400, "mout_aclk_hevc_400",
  244. mout_bus_mfc_pll_user_p, MUX_SEL_TOP2, 28, 1),
  245. MUX(CLK_MOUT_ACLK_CAM1_333, "mout_aclk_cam1_333",
  246. mout_mfc_bus_pll_user_p, MUX_SEL_TOP2, 16, 1),
  247. MUX(CLK_MOUT_ACLK_CAM1_552_B, "mout_aclk_cam1_552_b",
  248. mout_aclk_cam1_552_b_p, MUX_SEL_TOP2, 12, 1),
  249. MUX(CLK_MOUT_ACLK_CAM1_552_A, "mout_aclk_cam1_552_a",
  250. mout_aclk_cam1_552_a_p, MUX_SEL_TOP2, 8, 1),
  251. MUX(CLK_MOUT_ACLK_ISP_DIS_400, "mout_aclk_isp_dis_400",
  252. mout_bus_mfc_pll_user_p, MUX_SEL_TOP2, 4, 1),
  253. MUX(CLK_MOUT_ACLK_ISP_400, "mout_aclk_isp_400",
  254. mout_bus_mfc_pll_user_p, MUX_SEL_TOP2, 0, 1),
  255. /* MUX_SEL_TOP3 */
  256. MUX(CLK_MOUT_ACLK_BUS0_400, "mout_aclk_bus0_400",
  257. mout_bus_mphy_pll_user_p, MUX_SEL_TOP3, 20, 1),
  258. MUX(CLK_MOUT_ACLK_MSCL_400_B, "mout_aclk_mscl_400_b",
  259. mout_aclk_mscl_b_p, MUX_SEL_TOP3, 16, 1),
  260. MUX(CLK_MOUT_ACLK_MSCL_400_A, "mout_aclk_mscl_400_a",
  261. mout_bus_mfc_pll_user_p, MUX_SEL_TOP3, 12, 1),
  262. MUX(CLK_MOUT_ACLK_GSCL_333, "mout_aclk_gscl_333",
  263. mout_mfc_bus_pll_user_p, MUX_SEL_TOP3, 8, 1),
  264. MUX(CLK_MOUT_ACLK_G2D_400_B, "mout_aclk_g2d_400_b",
  265. mout_aclk_g2d_400_b_p, MUX_SEL_TOP3, 4, 1),
  266. MUX(CLK_MOUT_ACLK_G2D_400_A, "mout_aclk_g2d_400_a",
  267. mout_bus_mfc_pll_user_p, MUX_SEL_TOP3, 0, 1),
  268. /* MUX_SEL_TOP4 */
  269. MUX(CLK_MOUT_ACLK_MFC_400_C, "mout_aclk_mfc_400_c",
  270. mout_aclk_mfc_400_c_p, MUX_SEL_TOP4, 8, 1),
  271. MUX(CLK_MOUT_ACLK_MFC_400_B, "mout_aclk_mfc_400_b",
  272. mout_aclk_mfc_400_b_p, MUX_SEL_TOP4, 4, 1),
  273. MUX(CLK_MOUT_ACLK_MFC_400_A, "mout_aclk_mfc_400_a",
  274. mout_aclk_mfc_400_a_p, MUX_SEL_TOP4, 0, 1),
  275. /* MUX_SEL_TOP_MSCL */
  276. MUX(CLK_MOUT_SCLK_JPEG_C, "mout_sclk_jpeg_c", mout_sclk_jpeg_c_p,
  277. MUX_SEL_TOP_MSCL, 8, 1),
  278. MUX(CLK_MOUT_SCLK_JPEG_B, "mout_sclk_jpeg_b", mout_sclk_jpeg_b_p,
  279. MUX_SEL_TOP_MSCL, 4, 1),
  280. MUX(CLK_MOUT_SCLK_JPEG_A, "mout_sclk_jpeg_a", mout_bus_pll_user_t_p,
  281. MUX_SEL_TOP_MSCL, 0, 1),
  282. /* MUX_SEL_TOP_CAM1 */
  283. MUX(CLK_MOUT_SCLK_ISP_SENSOR2, "mout_sclk_isp_sensor2",
  284. mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 24, 1),
  285. MUX(CLK_MOUT_SCLK_ISP_SENSOR1, "mout_sclk_isp_sensor1",
  286. mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 20, 1),
  287. MUX(CLK_MOUT_SCLK_ISP_SENSOR0, "mout_sclk_isp_sensor0",
  288. mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 16, 1),
  289. MUX(CLK_MOUT_SCLK_ISP_UART, "mout_sclk_isp_uart",
  290. mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 8, 1),
  291. MUX(CLK_MOUT_SCLK_ISP_SPI1, "mout_sclk_isp_spi1",
  292. mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 4, 1),
  293. MUX(CLK_MOUT_SCLK_ISP_SPI0, "mout_sclk_isp_spi0",
  294. mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 0, 1),
  295. /* MUX_SEL_TOP_FSYS0 */
  296. MUX(CLK_MOUT_SCLK_MMC2_B, "mout_sclk_mmc2_b", mout_sclk_mmc2_b_p,
  297. MUX_SEL_TOP_FSYS0, 28, 1),
  298. MUX(CLK_MOUT_SCLK_MMC2_A, "mout_sclk_mmc2_a", mout_bus_pll_user_t_p,
  299. MUX_SEL_TOP_FSYS0, 24, 1),
  300. MUX(CLK_MOUT_SCLK_MMC1_B, "mout_sclk_mmc1_b", mout_sclk_mmc1_b_p,
  301. MUX_SEL_TOP_FSYS0, 20, 1),
  302. MUX(CLK_MOUT_SCLK_MMC1_A, "mout_sclk_mmc1_a", mout_bus_pll_user_t_p,
  303. MUX_SEL_TOP_FSYS0, 16, 1),
  304. MUX(CLK_MOUT_SCLK_MMC0_D, "mout_sclk_mmc0_d", mout_sclk_mmc0_d_p,
  305. MUX_SEL_TOP_FSYS0, 12, 1),
  306. MUX(CLK_MOUT_SCLK_MMC0_C, "mout_sclk_mmc0_c", mout_sclk_mmc0_c_p,
  307. MUX_SEL_TOP_FSYS0, 8, 1),
  308. MUX(CLK_MOUT_SCLK_MMC0_B, "mout_sclk_mmc0_b", mout_sclk_mmc0_b_p,
  309. MUX_SEL_TOP_FSYS0, 4, 1),
  310. MUX(CLK_MOUT_SCLK_MMC0_A, "mout_sclk_mmc0_a", mout_bus_pll_user_t_p,
  311. MUX_SEL_TOP_FSYS0, 0, 1),
  312. /* MUX_SEL_TOP_FSYS1 */
  313. MUX(CLK_MOUT_SCLK_PCIE_100, "mout_sclk_pcie_100", mout_bus_pll_user_t_p,
  314. MUX_SEL_TOP_FSYS1, 12, 1),
  315. MUX(CLK_MOUT_SCLK_UFSUNIPRO, "mout_sclk_ufsunipro",
  316. mout_mphy_pll_user_t_p, MUX_SEL_TOP_FSYS1, 8, 1),
  317. MUX(CLK_MOUT_SCLK_USBHOST30, "mout_sclk_usbhost30",
  318. mout_bus_pll_user_t_p, MUX_SEL_TOP_FSYS1, 4, 1),
  319. MUX(CLK_MOUT_SCLK_USBDRD30, "mout_sclk_usbdrd30",
  320. mout_bus_pll_user_t_p, MUX_SEL_TOP_FSYS1, 0, 1),
  321. /* MUX_SEL_TOP_PERIC0 */
  322. MUX(CLK_MOUT_SCLK_SPI4, "mout_sclk_spi4", mout_bus_pll_user_t_p,
  323. MUX_SEL_TOP_PERIC0, 28, 1),
  324. MUX(CLK_MOUT_SCLK_SPI3, "mout_sclk_spi3", mout_bus_pll_user_t_p,
  325. MUX_SEL_TOP_PERIC0, 24, 1),
  326. MUX(CLK_MOUT_SCLK_UART2, "mout_sclk_uart2", mout_bus_pll_user_t_p,
  327. MUX_SEL_TOP_PERIC0, 20, 1),
  328. MUX(CLK_MOUT_SCLK_UART1, "mout_sclk_uart1", mout_bus_pll_user_t_p,
  329. MUX_SEL_TOP_PERIC0, 16, 1),
  330. MUX(CLK_MOUT_SCLK_UART0, "mout_sclk_uart0", mout_bus_pll_user_t_p,
  331. MUX_SEL_TOP_PERIC0, 12, 1),
  332. MUX(CLK_MOUT_SCLK_SPI2, "mout_sclk_spi2", mout_bus_pll_user_t_p,
  333. MUX_SEL_TOP_PERIC0, 8, 1),
  334. MUX(CLK_MOUT_SCLK_SPI1, "mout_sclk_spi1", mout_bus_pll_user_t_p,
  335. MUX_SEL_TOP_PERIC0, 4, 1),
  336. MUX(CLK_MOUT_SCLK_SPI0, "mout_sclk_spi0", mout_bus_pll_user_t_p,
  337. MUX_SEL_TOP_PERIC0, 0, 1),
  338. /* MUX_SEL_TOP_PERIC1 */
  339. MUX(CLK_MOUT_SCLK_SLIMBUS, "mout_sclk_slimbus", mout_aud_pll_user_p,
  340. MUX_SEL_TOP_PERIC1, 16, 1),
  341. MUX(CLK_MOUT_SCLK_SPDIF, "mout_sclk_spdif", mout_sclk_spdif_p,
  342. MUX_SEL_TOP_PERIC1, 12, 2),
  343. MUX(CLK_MOUT_SCLK_AUDIO1, "mout_sclk_audio1", mout_sclk_audio1_p,
  344. MUX_SEL_TOP_PERIC1, 4, 2),
  345. MUX(CLK_MOUT_SCLK_AUDIO0, "mout_sclk_audio0", mout_sclk_audio0_p,
  346. MUX_SEL_TOP_PERIC1, 0, 2),
  347. /* MUX_SEL_TOP_DISP */
  348. MUX(CLK_MOUT_SCLK_HDMI_SPDIF, "mout_sclk_hdmi_spdif",
  349. mout_sclk_hdmi_spdif_p, MUX_SEL_TOP_DISP, 0, 1),
  350. };
  351. static const struct samsung_div_clock top_div_clks[] __initconst = {
  352. /* DIV_TOP0 */
  353. DIV(CLK_DIV_ACLK_CAM1_333, "div_aclk_cam1_333", "mout_aclk_cam1_333",
  354. DIV_TOP0, 28, 3),
  355. DIV(CLK_DIV_ACLK_CAM1_400, "div_aclk_cam1_400", "mout_bus_pll_user",
  356. DIV_TOP0, 24, 3),
  357. DIV(CLK_DIV_ACLK_CAM1_552, "div_aclk_cam1_552", "mout_aclk_cam1_552_b",
  358. DIV_TOP0, 20, 3),
  359. DIV(CLK_DIV_ACLK_CAM0_333, "div_aclk_cam0_333", "mout_mfc_pll_user",
  360. DIV_TOP0, 16, 3),
  361. DIV(CLK_DIV_ACLK_CAM0_400, "div_aclk_cam0_400", "mout_bus_pll_user",
  362. DIV_TOP0, 12, 3),
  363. DIV(CLK_DIV_ACLK_CAM0_552, "div_aclk_cam0_552", "mout_isp_pll",
  364. DIV_TOP0, 8, 3),
  365. DIV(CLK_DIV_ACLK_ISP_DIS_400, "div_aclk_isp_dis_400",
  366. "mout_aclk_isp_dis_400", DIV_TOP0, 4, 4),
  367. DIV(CLK_DIV_ACLK_ISP_400, "div_aclk_isp_400",
  368. "mout_aclk_isp_400", DIV_TOP0, 0, 4),
  369. /* DIV_TOP1 */
  370. DIV(CLK_DIV_ACLK_GSCL_111, "div_aclk_gscl_111", "mout_aclk_gscl_333",
  371. DIV_TOP1, 28, 3),
  372. DIV(CLK_DIV_ACLK_GSCL_333, "div_aclk_gscl_333", "mout_aclk_gscl_333",
  373. DIV_TOP1, 24, 3),
  374. DIV(CLK_DIV_ACLK_HEVC_400, "div_aclk_hevc_400", "mout_aclk_hevc_400",
  375. DIV_TOP1, 20, 3),
  376. DIV(CLK_DIV_ACLK_MFC_400, "div_aclk_mfc_400", "mout_aclk_mfc_400_c",
  377. DIV_TOP1, 12, 3),
  378. DIV(CLK_DIV_ACLK_G2D_266, "div_aclk_g2d_266", "mout_bus_pll_user",
  379. DIV_TOP1, 8, 3),
  380. DIV(CLK_DIV_ACLK_G2D_400, "div_aclk_g2d_400", "mout_aclk_g2d_400_b",
  381. DIV_TOP1, 0, 3),
  382. /* DIV_TOP2 */
  383. DIV(CLK_DIV_ACLK_MSCL_400, "div_aclk_mscl_400", "mout_aclk_mscl_400_b",
  384. DIV_TOP2, 4, 3),
  385. DIV(CLK_DIV_ACLK_FSYS_200, "div_aclk_fsys_200", "mout_bus_pll_user",
  386. DIV_TOP2, 0, 3),
  387. /* DIV_TOP3 */
  388. DIV(CLK_DIV_ACLK_IMEM_SSSX_266, "div_aclk_imem_sssx_266",
  389. "mout_bus_pll_user", DIV_TOP3, 24, 3),
  390. DIV(CLK_DIV_ACLK_IMEM_200, "div_aclk_imem_200",
  391. "mout_bus_pll_user", DIV_TOP3, 20, 3),
  392. DIV(CLK_DIV_ACLK_IMEM_266, "div_aclk_imem_266",
  393. "mout_bus_pll_user", DIV_TOP3, 16, 3),
  394. DIV(CLK_DIV_ACLK_PERIC_66_B, "div_aclk_peric_66_b",
  395. "div_aclk_peric_66_a", DIV_TOP3, 12, 3),
  396. DIV(CLK_DIV_ACLK_PERIC_66_A, "div_aclk_peric_66_a",
  397. "mout_bus_pll_user", DIV_TOP3, 8, 3),
  398. DIV(CLK_DIV_ACLK_PERIS_66_B, "div_aclk_peris_66_b",
  399. "div_aclk_peris_66_a", DIV_TOP3, 4, 3),
  400. DIV(CLK_DIV_ACLK_PERIS_66_A, "div_aclk_peris_66_a",
  401. "mout_bus_pll_user", DIV_TOP3, 0, 3),
  402. /* DIV_TOP4 */
  403. DIV(CLK_DIV_ACLK_G3D_400, "div_aclk_g3d_400", "mout_bus_pll_user",
  404. DIV_TOP4, 8, 3),
  405. DIV(CLK_DIV_ACLK_BUS0_400, "div_aclk_bus0_400", "mout_aclk_bus0_400",
  406. DIV_TOP4, 4, 3),
  407. DIV(CLK_DIV_ACLK_BUS1_400, "div_aclk_bus1_400", "mout_bus_pll_user",
  408. DIV_TOP4, 0, 3),
  409. /* DIV_TOP_MSCL */
  410. DIV(CLK_DIV_SCLK_JPEG, "div_sclk_jpeg", "mout_sclk_jpeg_c",
  411. DIV_TOP_MSCL, 0, 4),
  412. /* DIV_TOP_CAM10 */
  413. DIV(CLK_DIV_SCLK_ISP_UART, "div_sclk_isp_uart", "mout_sclk_isp_uart",
  414. DIV_TOP_CAM10, 24, 5),
  415. DIV(CLK_DIV_SCLK_ISP_SPI1_B, "div_sclk_isp_spi1_b",
  416. "div_sclk_isp_spi1_a", DIV_TOP_CAM10, 16, 8),
  417. DIV(CLK_DIV_SCLK_ISP_SPI1_A, "div_sclk_isp_spi1_a",
  418. "mout_sclk_isp_spi1", DIV_TOP_CAM10, 12, 4),
  419. DIV(CLK_DIV_SCLK_ISP_SPI0_B, "div_sclk_isp_spi0_b",
  420. "div_sclk_isp_spi0_a", DIV_TOP_CAM10, 4, 8),
  421. DIV(CLK_DIV_SCLK_ISP_SPI0_A, "div_sclk_isp_spi0_a",
  422. "mout_sclk_isp_spi0", DIV_TOP_CAM10, 0, 4),
  423. /* DIV_TOP_CAM11 */
  424. DIV(CLK_DIV_SCLK_ISP_SENSOR2_B, "div_sclk_isp_sensor2_b",
  425. "div_sclk_isp_sensor2_a", DIV_TOP_CAM11, 20, 4),
  426. DIV(CLK_DIV_SCLK_ISP_SENSOR2_A, "div_sclk_isp_sensor2_a",
  427. "mout_sclk_isp_sensor2", DIV_TOP_CAM11, 16, 4),
  428. DIV(CLK_DIV_SCLK_ISP_SENSOR1_B, "div_sclk_isp_sensor1_b",
  429. "div_sclk_isp_sensor1_a", DIV_TOP_CAM11, 12, 4),
  430. DIV(CLK_DIV_SCLK_ISP_SENSOR1_A, "div_sclk_isp_sensor1_a",
  431. "mout_sclk_isp_sensor1", DIV_TOP_CAM11, 8, 4),
  432. DIV(CLK_DIV_SCLK_ISP_SENSOR0_B, "div_sclk_isp_sensor0_b",
  433. "div_sclk_isp_sensor0_a", DIV_TOP_CAM11, 4, 4),
  434. DIV(CLK_DIV_SCLK_ISP_SENSOR0_A, "div_sclk_isp_sensor0_a",
  435. "mout_sclk_isp_sensor0", DIV_TOP_CAM11, 0, 4),
  436. /* DIV_TOP_FSYS0 */
  437. DIV(CLK_DIV_SCLK_MMC1_B, "div_sclk_mmc1_b", "div_sclk_mmc1_a",
  438. DIV_TOP_FSYS0, 16, 8),
  439. DIV(CLK_DIV_SCLK_MMC1_A, "div_sclk_mmc1_a", "mout_sclk_mmc1_b",
  440. DIV_TOP_FSYS0, 12, 4),
  441. DIV_F(CLK_DIV_SCLK_MMC0_B, "div_sclk_mmc0_b", "div_sclk_mmc0_a",
  442. DIV_TOP_FSYS0, 4, 8, CLK_SET_RATE_PARENT, 0),
  443. DIV_F(CLK_DIV_SCLK_MMC0_A, "div_sclk_mmc0_a", "mout_sclk_mmc0_d",
  444. DIV_TOP_FSYS0, 0, 4, CLK_SET_RATE_PARENT, 0),
  445. /* DIV_TOP_FSYS1 */
  446. DIV(CLK_DIV_SCLK_MMC2_B, "div_sclk_mmc2_b", "div_sclk_mmc2_a",
  447. DIV_TOP_FSYS1, 4, 8),
  448. DIV(CLK_DIV_SCLK_MMC2_A, "div_sclk_mmc2_a", "mout_sclk_mmc2_b",
  449. DIV_TOP_FSYS1, 0, 4),
  450. /* DIV_TOP_FSYS2 */
  451. DIV(CLK_DIV_SCLK_PCIE_100, "div_sclk_pcie_100", "mout_sclk_pcie_100",
  452. DIV_TOP_FSYS2, 12, 3),
  453. DIV(CLK_DIV_SCLK_USBHOST30, "div_sclk_usbhost30",
  454. "mout_sclk_usbhost30", DIV_TOP_FSYS2, 8, 4),
  455. DIV(CLK_DIV_SCLK_UFSUNIPRO, "div_sclk_ufsunipro",
  456. "mout_sclk_ufsunipro", DIV_TOP_FSYS2, 4, 4),
  457. DIV(CLK_DIV_SCLK_USBDRD30, "div_sclk_usbdrd30", "mout_sclk_usbdrd30",
  458. DIV_TOP_FSYS2, 0, 4),
  459. /* DIV_TOP_PERIC0 */
  460. DIV(CLK_DIV_SCLK_SPI1_B, "div_sclk_spi1_b", "div_sclk_spi1_a",
  461. DIV_TOP_PERIC0, 16, 8),
  462. DIV(CLK_DIV_SCLK_SPI1_A, "div_sclk_spi1_a", "mout_sclk_spi1",
  463. DIV_TOP_PERIC0, 12, 4),
  464. DIV(CLK_DIV_SCLK_SPI0_B, "div_sclk_spi0_b", "div_sclk_spi0_a",
  465. DIV_TOP_PERIC0, 4, 8),
  466. DIV(CLK_DIV_SCLK_SPI0_A, "div_sclk_spi0_a", "mout_sclk_spi0",
  467. DIV_TOP_PERIC0, 0, 4),
  468. /* DIV_TOP_PERIC1 */
  469. DIV(CLK_DIV_SCLK_SPI2_B, "div_sclk_spi2_b", "div_sclk_spi2_a",
  470. DIV_TOP_PERIC1, 4, 8),
  471. DIV(CLK_DIV_SCLK_SPI2_A, "div_sclk_spi2_a", "mout_sclk_spi2",
  472. DIV_TOP_PERIC1, 0, 4),
  473. /* DIV_TOP_PERIC2 */
  474. DIV(CLK_DIV_SCLK_UART2, "div_sclk_uart2", "mout_sclk_uart2",
  475. DIV_TOP_PERIC2, 8, 4),
  476. DIV(CLK_DIV_SCLK_UART1, "div_sclk_uart1", "mout_sclk_uart0",
  477. DIV_TOP_PERIC2, 4, 4),
  478. DIV(CLK_DIV_SCLK_UART0, "div_sclk_uart0", "mout_sclk_uart1",
  479. DIV_TOP_PERIC2, 0, 4),
  480. /* DIV_TOP_PERIC3 */
  481. DIV(CLK_DIV_SCLK_I2S1, "div_sclk_i2s1", "sclk_audio1",
  482. DIV_TOP_PERIC3, 16, 6),
  483. DIV(CLK_DIV_SCLK_PCM1, "div_sclk_pcm1", "sclk_audio1",
  484. DIV_TOP_PERIC3, 8, 8),
  485. DIV(CLK_DIV_SCLK_AUDIO1, "div_sclk_audio1", "mout_sclk_audio1",
  486. DIV_TOP_PERIC3, 4, 4),
  487. DIV(CLK_DIV_SCLK_AUDIO0, "div_sclk_audio0", "mout_sclk_audio0",
  488. DIV_TOP_PERIC3, 0, 4),
  489. /* DIV_TOP_PERIC4 */
  490. DIV(CLK_DIV_SCLK_SPI4_B, "div_sclk_spi4_b", "div_sclk_spi4_a",
  491. DIV_TOP_PERIC4, 16, 8),
  492. DIV(CLK_DIV_SCLK_SPI4_A, "div_sclk_spi4_a", "mout_sclk_spi4",
  493. DIV_TOP_PERIC4, 12, 4),
  494. DIV(CLK_DIV_SCLK_SPI3_B, "div_sclk_spi3_b", "div_sclk_spi3_a",
  495. DIV_TOP_PERIC4, 4, 8),
  496. DIV(CLK_DIV_SCLK_SPI3_A, "div_sclk_spi3_a", "mout_sclk_spi3",
  497. DIV_TOP_PERIC4, 0, 4),
  498. };
  499. static const struct samsung_gate_clock top_gate_clks[] __initconst = {
  500. /* ENABLE_ACLK_TOP */
  501. GATE(CLK_ACLK_G3D_400, "aclk_g3d_400", "div_aclk_g3d_400",
  502. ENABLE_ACLK_TOP, 30, CLK_IS_CRITICAL, 0),
  503. GATE(CLK_ACLK_IMEM_SSX_266, "aclk_imem_ssx_266",
  504. "div_aclk_imem_sssx_266", ENABLE_ACLK_TOP,
  505. 29, CLK_IGNORE_UNUSED, 0),
  506. GATE(CLK_ACLK_BUS0_400, "aclk_bus0_400", "div_aclk_bus0_400",
  507. ENABLE_ACLK_TOP, 26,
  508. CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
  509. GATE(CLK_ACLK_BUS1_400, "aclk_bus1_400", "div_aclk_bus1_400",
  510. ENABLE_ACLK_TOP, 25,
  511. CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
  512. GATE(CLK_ACLK_IMEM_200, "aclk_imem_200", "div_aclk_imem_266",
  513. ENABLE_ACLK_TOP, 24,
  514. CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
  515. GATE(CLK_ACLK_IMEM_266, "aclk_imem_266", "div_aclk_imem_200",
  516. ENABLE_ACLK_TOP, 23,
  517. CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
  518. GATE(CLK_ACLK_PERIC_66, "aclk_peric_66", "div_aclk_peric_66_b",
  519. ENABLE_ACLK_TOP, 22,
  520. CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
  521. GATE(CLK_ACLK_PERIS_66, "aclk_peris_66", "div_aclk_peris_66_b",
  522. ENABLE_ACLK_TOP, 21,
  523. CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
  524. GATE(CLK_ACLK_MSCL_400, "aclk_mscl_400", "div_aclk_mscl_400",
  525. ENABLE_ACLK_TOP, 19,
  526. CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
  527. GATE(CLK_ACLK_FSYS_200, "aclk_fsys_200", "div_aclk_fsys_200",
  528. ENABLE_ACLK_TOP, 18,
  529. CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
  530. GATE(CLK_ACLK_GSCL_111, "aclk_gscl_111", "div_aclk_gscl_111",
  531. ENABLE_ACLK_TOP, 15,
  532. CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
  533. GATE(CLK_ACLK_GSCL_333, "aclk_gscl_333", "div_aclk_gscl_333",
  534. ENABLE_ACLK_TOP, 14,
  535. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  536. GATE(CLK_ACLK_CAM1_333, "aclk_cam1_333", "div_aclk_cam1_333",
  537. ENABLE_ACLK_TOP, 13,
  538. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  539. GATE(CLK_ACLK_CAM1_400, "aclk_cam1_400", "div_aclk_cam1_400",
  540. ENABLE_ACLK_TOP, 12,
  541. CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
  542. GATE(CLK_ACLK_CAM1_552, "aclk_cam1_552", "div_aclk_cam1_552",
  543. ENABLE_ACLK_TOP, 11,
  544. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  545. GATE(CLK_ACLK_CAM0_333, "aclk_cam0_333", "div_aclk_cam0_333",
  546. ENABLE_ACLK_TOP, 10,
  547. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  548. GATE(CLK_ACLK_CAM0_400, "aclk_cam0_400", "div_aclk_cam0_400",
  549. ENABLE_ACLK_TOP, 9,
  550. CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
  551. GATE(CLK_ACLK_CAM0_552, "aclk_cam0_552", "div_aclk_cam0_552",
  552. ENABLE_ACLK_TOP, 8,
  553. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  554. GATE(CLK_ACLK_ISP_DIS_400, "aclk_isp_dis_400", "div_aclk_isp_dis_400",
  555. ENABLE_ACLK_TOP, 7,
  556. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  557. GATE(CLK_ACLK_ISP_400, "aclk_isp_400", "div_aclk_isp_400",
  558. ENABLE_ACLK_TOP, 6,
  559. CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
  560. GATE(CLK_ACLK_HEVC_400, "aclk_hevc_400", "div_aclk_hevc_400",
  561. ENABLE_ACLK_TOP, 5,
  562. CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
  563. GATE(CLK_ACLK_MFC_400, "aclk_mfc_400", "div_aclk_mfc_400",
  564. ENABLE_ACLK_TOP, 3,
  565. CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
  566. GATE(CLK_ACLK_G2D_266, "aclk_g2d_266", "div_aclk_g2d_266",
  567. ENABLE_ACLK_TOP, 2,
  568. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  569. GATE(CLK_ACLK_G2D_400, "aclk_g2d_400", "div_aclk_g2d_400",
  570. ENABLE_ACLK_TOP, 0,
  571. CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
  572. /* ENABLE_SCLK_TOP_MSCL */
  573. GATE(CLK_SCLK_JPEG_MSCL, "sclk_jpeg_mscl", "div_sclk_jpeg",
  574. ENABLE_SCLK_TOP_MSCL, 0, CLK_SET_RATE_PARENT, 0),
  575. /* ENABLE_SCLK_TOP_CAM1 */
  576. GATE(CLK_SCLK_ISP_SENSOR2, "sclk_isp_sensor2", "div_sclk_isp_sensor2_b",
  577. ENABLE_SCLK_TOP_CAM1, 7, 0, 0),
  578. GATE(CLK_SCLK_ISP_SENSOR1, "sclk_isp_sensor1", "div_sclk_isp_sensor1_b",
  579. ENABLE_SCLK_TOP_CAM1, 6, 0, 0),
  580. GATE(CLK_SCLK_ISP_SENSOR0, "sclk_isp_sensor0", "div_sclk_isp_sensor0_b",
  581. ENABLE_SCLK_TOP_CAM1, 5, 0, 0),
  582. GATE(CLK_SCLK_ISP_MCTADC_CAM1, "sclk_isp_mctadc_cam1", "oscclk",
  583. ENABLE_SCLK_TOP_CAM1, 4, 0, 0),
  584. GATE(CLK_SCLK_ISP_UART_CAM1, "sclk_isp_uart_cam1", "div_sclk_isp_uart",
  585. ENABLE_SCLK_TOP_CAM1, 2, 0, 0),
  586. GATE(CLK_SCLK_ISP_SPI1_CAM1, "sclk_isp_spi1_cam1", "div_sclk_isp_spi1_b",
  587. ENABLE_SCLK_TOP_CAM1, 1, 0, 0),
  588. GATE(CLK_SCLK_ISP_SPI0_CAM1, "sclk_isp_spi0_cam1", "div_sclk_isp_spi0_b",
  589. ENABLE_SCLK_TOP_CAM1, 0, 0, 0),
  590. /* ENABLE_SCLK_TOP_DISP */
  591. GATE(CLK_SCLK_HDMI_SPDIF_DISP, "sclk_hdmi_spdif_disp",
  592. "mout_sclk_hdmi_spdif", ENABLE_SCLK_TOP_DISP, 0,
  593. CLK_IGNORE_UNUSED, 0),
  594. /* ENABLE_SCLK_TOP_FSYS */
  595. GATE(CLK_SCLK_PCIE_100_FSYS, "sclk_pcie_100_fsys", "div_sclk_pcie_100",
  596. ENABLE_SCLK_TOP_FSYS, 7, CLK_IGNORE_UNUSED, 0),
  597. GATE(CLK_SCLK_MMC2_FSYS, "sclk_mmc2_fsys", "div_sclk_mmc2_b",
  598. ENABLE_SCLK_TOP_FSYS, 6, CLK_SET_RATE_PARENT, 0),
  599. GATE(CLK_SCLK_MMC1_FSYS, "sclk_mmc1_fsys", "div_sclk_mmc1_b",
  600. ENABLE_SCLK_TOP_FSYS, 5, CLK_SET_RATE_PARENT, 0),
  601. GATE(CLK_SCLK_MMC0_FSYS, "sclk_mmc0_fsys", "div_sclk_mmc0_b",
  602. ENABLE_SCLK_TOP_FSYS, 4, CLK_SET_RATE_PARENT, 0),
  603. GATE(CLK_SCLK_UFSUNIPRO_FSYS, "sclk_ufsunipro_fsys",
  604. "div_sclk_ufsunipro", ENABLE_SCLK_TOP_FSYS,
  605. 3, CLK_SET_RATE_PARENT, 0),
  606. GATE(CLK_SCLK_USBHOST30_FSYS, "sclk_usbhost30_fsys",
  607. "div_sclk_usbhost30", ENABLE_SCLK_TOP_FSYS,
  608. 1, CLK_SET_RATE_PARENT, 0),
  609. GATE(CLK_SCLK_USBDRD30_FSYS, "sclk_usbdrd30_fsys",
  610. "div_sclk_usbdrd30", ENABLE_SCLK_TOP_FSYS,
  611. 0, CLK_SET_RATE_PARENT, 0),
  612. /* ENABLE_SCLK_TOP_PERIC */
  613. GATE(CLK_SCLK_SPI4_PERIC, "sclk_spi4_peric", "div_sclk_spi4_b",
  614. ENABLE_SCLK_TOP_PERIC, 12, CLK_SET_RATE_PARENT, 0),
  615. GATE(CLK_SCLK_SPI3_PERIC, "sclk_spi3_peric", "div_sclk_spi3_b",
  616. ENABLE_SCLK_TOP_PERIC, 11, CLK_SET_RATE_PARENT, 0),
  617. GATE(CLK_SCLK_SPDIF_PERIC, "sclk_spdif_peric", "mout_sclk_spdif",
  618. ENABLE_SCLK_TOP_PERIC, 9, CLK_SET_RATE_PARENT, 0),
  619. GATE(CLK_SCLK_I2S1_PERIC, "sclk_i2s1_peric", "div_sclk_i2s1",
  620. ENABLE_SCLK_TOP_PERIC, 8, CLK_SET_RATE_PARENT, 0),
  621. GATE(CLK_SCLK_PCM1_PERIC, "sclk_pcm1_peric", "div_sclk_pcm1",
  622. ENABLE_SCLK_TOP_PERIC, 7, CLK_SET_RATE_PARENT, 0),
  623. GATE(CLK_SCLK_UART2_PERIC, "sclk_uart2_peric", "div_sclk_uart2",
  624. ENABLE_SCLK_TOP_PERIC, 5, CLK_SET_RATE_PARENT |
  625. CLK_IGNORE_UNUSED, 0),
  626. GATE(CLK_SCLK_UART1_PERIC, "sclk_uart1_peric", "div_sclk_uart1",
  627. ENABLE_SCLK_TOP_PERIC, 4, CLK_SET_RATE_PARENT |
  628. CLK_IGNORE_UNUSED, 0),
  629. GATE(CLK_SCLK_UART0_PERIC, "sclk_uart0_peric", "div_sclk_uart0",
  630. ENABLE_SCLK_TOP_PERIC, 3, CLK_SET_RATE_PARENT |
  631. CLK_IGNORE_UNUSED, 0),
  632. GATE(CLK_SCLK_SPI2_PERIC, "sclk_spi2_peric", "div_sclk_spi2_b",
  633. ENABLE_SCLK_TOP_PERIC, 2, CLK_SET_RATE_PARENT, 0),
  634. GATE(CLK_SCLK_SPI1_PERIC, "sclk_spi1_peric", "div_sclk_spi1_b",
  635. ENABLE_SCLK_TOP_PERIC, 1, CLK_SET_RATE_PARENT, 0),
  636. GATE(CLK_SCLK_SPI0_PERIC, "sclk_spi0_peric", "div_sclk_spi0_b",
  637. ENABLE_SCLK_TOP_PERIC, 0, CLK_SET_RATE_PARENT, 0),
  638. /* MUX_ENABLE_TOP_PERIC1 */
  639. GATE(CLK_SCLK_SLIMBUS, "sclk_slimbus", "mout_sclk_slimbus",
  640. MUX_ENABLE_TOP_PERIC1, 16, 0, 0),
  641. GATE(CLK_SCLK_AUDIO1, "sclk_audio1", "div_sclk_audio1",
  642. MUX_ENABLE_TOP_PERIC1, 4, 0, 0),
  643. GATE(CLK_SCLK_AUDIO0, "sclk_audio0", "div_sclk_audio0",
  644. MUX_ENABLE_TOP_PERIC1, 0, 0, 0),
  645. };
  646. /*
  647. * ATLAS_PLL & APOLLO_PLL & MEM0_PLL & MEM1_PLL & BUS_PLL & MFC_PLL
  648. * & MPHY_PLL & G3D_PLL & DISP_PLL & ISP_PLL
  649. */
  650. static const struct samsung_pll_rate_table exynos5433_pll_rates[] __initconst = {
  651. PLL_35XX_RATE(2500000000U, 625, 6, 0),
  652. PLL_35XX_RATE(2400000000U, 500, 5, 0),
  653. PLL_35XX_RATE(2300000000U, 575, 6, 0),
  654. PLL_35XX_RATE(2200000000U, 550, 6, 0),
  655. PLL_35XX_RATE(2100000000U, 350, 4, 0),
  656. PLL_35XX_RATE(2000000000U, 500, 6, 0),
  657. PLL_35XX_RATE(1900000000U, 475, 6, 0),
  658. PLL_35XX_RATE(1800000000U, 375, 5, 0),
  659. PLL_35XX_RATE(1700000000U, 425, 6, 0),
  660. PLL_35XX_RATE(1600000000U, 400, 6, 0),
  661. PLL_35XX_RATE(1500000000U, 250, 4, 0),
  662. PLL_35XX_RATE(1400000000U, 350, 6, 0),
  663. PLL_35XX_RATE(1332000000U, 222, 4, 0),
  664. PLL_35XX_RATE(1300000000U, 325, 6, 0),
  665. PLL_35XX_RATE(1200000000U, 500, 5, 1),
  666. PLL_35XX_RATE(1100000000U, 550, 6, 1),
  667. PLL_35XX_RATE(1086000000U, 362, 4, 1),
  668. PLL_35XX_RATE(1066000000U, 533, 6, 1),
  669. PLL_35XX_RATE(1000000000U, 500, 6, 1),
  670. PLL_35XX_RATE(933000000U, 311, 4, 1),
  671. PLL_35XX_RATE(921000000U, 307, 4, 1),
  672. PLL_35XX_RATE(900000000U, 375, 5, 1),
  673. PLL_35XX_RATE(825000000U, 275, 4, 1),
  674. PLL_35XX_RATE(800000000U, 400, 6, 1),
  675. PLL_35XX_RATE(733000000U, 733, 12, 1),
  676. PLL_35XX_RATE(700000000U, 175, 3, 1),
  677. PLL_35XX_RATE(666000000U, 222, 4, 1),
  678. PLL_35XX_RATE(633000000U, 211, 4, 1),
  679. PLL_35XX_RATE(600000000U, 500, 5, 2),
  680. PLL_35XX_RATE(552000000U, 460, 5, 2),
  681. PLL_35XX_RATE(550000000U, 550, 6, 2),
  682. PLL_35XX_RATE(543000000U, 362, 4, 2),
  683. PLL_35XX_RATE(533000000U, 533, 6, 2),
  684. PLL_35XX_RATE(500000000U, 500, 6, 2),
  685. PLL_35XX_RATE(444000000U, 370, 5, 2),
  686. PLL_35XX_RATE(420000000U, 350, 5, 2),
  687. PLL_35XX_RATE(400000000U, 400, 6, 2),
  688. PLL_35XX_RATE(350000000U, 350, 6, 2),
  689. PLL_35XX_RATE(333000000U, 222, 4, 2),
  690. PLL_35XX_RATE(300000000U, 500, 5, 3),
  691. PLL_35XX_RATE(278000000U, 556, 6, 3),
  692. PLL_35XX_RATE(266000000U, 532, 6, 3),
  693. PLL_35XX_RATE(250000000U, 500, 6, 3),
  694. PLL_35XX_RATE(200000000U, 400, 6, 3),
  695. PLL_35XX_RATE(166000000U, 332, 6, 3),
  696. PLL_35XX_RATE(160000000U, 320, 6, 3),
  697. PLL_35XX_RATE(133000000U, 532, 6, 4),
  698. PLL_35XX_RATE(100000000U, 400, 6, 4),
  699. { /* sentinel */ }
  700. };
  701. /* AUD_PLL */
  702. static const struct samsung_pll_rate_table exynos5433_aud_pll_rates[] __initconst = {
  703. PLL_36XX_RATE(400000000U, 200, 3, 2, 0),
  704. PLL_36XX_RATE(393216003U, 197, 3, 2, -25690),
  705. PLL_36XX_RATE(384000000U, 128, 2, 2, 0),
  706. PLL_36XX_RATE(368639991U, 246, 4, 2, -15729),
  707. PLL_36XX_RATE(361507202U, 181, 3, 2, -16148),
  708. PLL_36XX_RATE(338687988U, 113, 2, 2, -6816),
  709. PLL_36XX_RATE(294912002U, 98, 1, 3, 19923),
  710. PLL_36XX_RATE(288000000U, 96, 1, 3, 0),
  711. PLL_36XX_RATE(252000000U, 84, 1, 3, 0),
  712. { /* sentinel */ }
  713. };
  714. static const struct samsung_pll_clock top_pll_clks[] __initconst = {
  715. PLL(pll_35xx, CLK_FOUT_ISP_PLL, "fout_isp_pll", "oscclk",
  716. ISP_PLL_LOCK, ISP_PLL_CON0, exynos5433_pll_rates),
  717. PLL(pll_36xx, CLK_FOUT_AUD_PLL, "fout_aud_pll", "oscclk",
  718. AUD_PLL_LOCK, AUD_PLL_CON0, exynos5433_aud_pll_rates),
  719. };
  720. static const struct samsung_cmu_info top_cmu_info __initconst = {
  721. .pll_clks = top_pll_clks,
  722. .nr_pll_clks = ARRAY_SIZE(top_pll_clks),
  723. .mux_clks = top_mux_clks,
  724. .nr_mux_clks = ARRAY_SIZE(top_mux_clks),
  725. .div_clks = top_div_clks,
  726. .nr_div_clks = ARRAY_SIZE(top_div_clks),
  727. .gate_clks = top_gate_clks,
  728. .nr_gate_clks = ARRAY_SIZE(top_gate_clks),
  729. .fixed_clks = top_fixed_clks,
  730. .nr_fixed_clks = ARRAY_SIZE(top_fixed_clks),
  731. .fixed_factor_clks = top_fixed_factor_clks,
  732. .nr_fixed_factor_clks = ARRAY_SIZE(top_fixed_factor_clks),
  733. .nr_clk_ids = TOP_NR_CLK,
  734. .clk_regs = top_clk_regs,
  735. .nr_clk_regs = ARRAY_SIZE(top_clk_regs),
  736. };
  737. static void __init exynos5433_cmu_top_init(struct device_node *np)
  738. {
  739. samsung_cmu_register_one(np, &top_cmu_info);
  740. }
  741. CLK_OF_DECLARE(exynos5433_cmu_top, "samsung,exynos5433-cmu-top",
  742. exynos5433_cmu_top_init);
  743. /*
  744. * Register offset definitions for CMU_CPIF
  745. */
  746. #define MPHY_PLL_LOCK 0x0000
  747. #define MPHY_PLL_CON0 0x0100
  748. #define MPHY_PLL_CON1 0x0104
  749. #define MPHY_PLL_FREQ_DET 0x010c
  750. #define MUX_SEL_CPIF0 0x0200
  751. #define DIV_CPIF 0x0600
  752. #define ENABLE_SCLK_CPIF 0x0a00
  753. static const unsigned long cpif_clk_regs[] __initconst = {
  754. MPHY_PLL_LOCK,
  755. MPHY_PLL_CON0,
  756. MPHY_PLL_CON1,
  757. MPHY_PLL_FREQ_DET,
  758. MUX_SEL_CPIF0,
  759. DIV_CPIF,
  760. ENABLE_SCLK_CPIF,
  761. };
  762. /* list of all parent clock list */
  763. PNAME(mout_mphy_pll_p) = { "oscclk", "fout_mphy_pll", };
  764. static const struct samsung_pll_clock cpif_pll_clks[] __initconst = {
  765. PLL(pll_35xx, CLK_FOUT_MPHY_PLL, "fout_mphy_pll", "oscclk",
  766. MPHY_PLL_LOCK, MPHY_PLL_CON0, exynos5433_pll_rates),
  767. };
  768. static const struct samsung_mux_clock cpif_mux_clks[] __initconst = {
  769. /* MUX_SEL_CPIF0 */
  770. MUX(CLK_MOUT_MPHY_PLL, "mout_mphy_pll", mout_mphy_pll_p, MUX_SEL_CPIF0,
  771. 0, 1),
  772. };
  773. static const struct samsung_div_clock cpif_div_clks[] __initconst = {
  774. /* DIV_CPIF */
  775. DIV(CLK_DIV_SCLK_MPHY, "div_sclk_mphy", "mout_mphy_pll", DIV_CPIF,
  776. 0, 6),
  777. };
  778. static const struct samsung_gate_clock cpif_gate_clks[] __initconst = {
  779. /* ENABLE_SCLK_CPIF */
  780. GATE(CLK_SCLK_MPHY_PLL, "sclk_mphy_pll", "mout_mphy_pll",
  781. ENABLE_SCLK_CPIF, 9, CLK_IGNORE_UNUSED, 0),
  782. GATE(CLK_SCLK_UFS_MPHY, "sclk_ufs_mphy", "div_sclk_mphy",
  783. ENABLE_SCLK_CPIF, 4, 0, 0),
  784. };
  785. static const struct samsung_cmu_info cpif_cmu_info __initconst = {
  786. .pll_clks = cpif_pll_clks,
  787. .nr_pll_clks = ARRAY_SIZE(cpif_pll_clks),
  788. .mux_clks = cpif_mux_clks,
  789. .nr_mux_clks = ARRAY_SIZE(cpif_mux_clks),
  790. .div_clks = cpif_div_clks,
  791. .nr_div_clks = ARRAY_SIZE(cpif_div_clks),
  792. .gate_clks = cpif_gate_clks,
  793. .nr_gate_clks = ARRAY_SIZE(cpif_gate_clks),
  794. .nr_clk_ids = CPIF_NR_CLK,
  795. .clk_regs = cpif_clk_regs,
  796. .nr_clk_regs = ARRAY_SIZE(cpif_clk_regs),
  797. };
  798. static void __init exynos5433_cmu_cpif_init(struct device_node *np)
  799. {
  800. samsung_cmu_register_one(np, &cpif_cmu_info);
  801. }
  802. CLK_OF_DECLARE(exynos5433_cmu_cpif, "samsung,exynos5433-cmu-cpif",
  803. exynos5433_cmu_cpif_init);
  804. /*
  805. * Register offset definitions for CMU_MIF
  806. */
  807. #define MEM0_PLL_LOCK 0x0000
  808. #define MEM1_PLL_LOCK 0x0004
  809. #define BUS_PLL_LOCK 0x0008
  810. #define MFC_PLL_LOCK 0x000c
  811. #define MEM0_PLL_CON0 0x0100
  812. #define MEM0_PLL_CON1 0x0104
  813. #define MEM0_PLL_FREQ_DET 0x010c
  814. #define MEM1_PLL_CON0 0x0110
  815. #define MEM1_PLL_CON1 0x0114
  816. #define MEM1_PLL_FREQ_DET 0x011c
  817. #define BUS_PLL_CON0 0x0120
  818. #define BUS_PLL_CON1 0x0124
  819. #define BUS_PLL_FREQ_DET 0x012c
  820. #define MFC_PLL_CON0 0x0130
  821. #define MFC_PLL_CON1 0x0134
  822. #define MFC_PLL_FREQ_DET 0x013c
  823. #define MUX_SEL_MIF0 0x0200
  824. #define MUX_SEL_MIF1 0x0204
  825. #define MUX_SEL_MIF2 0x0208
  826. #define MUX_SEL_MIF3 0x020c
  827. #define MUX_SEL_MIF4 0x0210
  828. #define MUX_SEL_MIF5 0x0214
  829. #define MUX_SEL_MIF6 0x0218
  830. #define MUX_SEL_MIF7 0x021c
  831. #define MUX_ENABLE_MIF0 0x0300
  832. #define MUX_ENABLE_MIF1 0x0304
  833. #define MUX_ENABLE_MIF2 0x0308
  834. #define MUX_ENABLE_MIF3 0x030c
  835. #define MUX_ENABLE_MIF4 0x0310
  836. #define MUX_ENABLE_MIF5 0x0314
  837. #define MUX_ENABLE_MIF6 0x0318
  838. #define MUX_ENABLE_MIF7 0x031c
  839. #define MUX_STAT_MIF0 0x0400
  840. #define MUX_STAT_MIF1 0x0404
  841. #define MUX_STAT_MIF2 0x0408
  842. #define MUX_STAT_MIF3 0x040c
  843. #define MUX_STAT_MIF4 0x0410
  844. #define MUX_STAT_MIF5 0x0414
  845. #define MUX_STAT_MIF6 0x0418
  846. #define MUX_STAT_MIF7 0x041c
  847. #define DIV_MIF1 0x0604
  848. #define DIV_MIF2 0x0608
  849. #define DIV_MIF3 0x060c
  850. #define DIV_MIF4 0x0610
  851. #define DIV_MIF5 0x0614
  852. #define DIV_MIF_PLL_FREQ_DET 0x0618
  853. #define DIV_STAT_MIF1 0x0704
  854. #define DIV_STAT_MIF2 0x0708
  855. #define DIV_STAT_MIF3 0x070c
  856. #define DIV_STAT_MIF4 0x0710
  857. #define DIV_STAT_MIF5 0x0714
  858. #define DIV_STAT_MIF_PLL_FREQ_DET 0x0718
  859. #define ENABLE_ACLK_MIF0 0x0800
  860. #define ENABLE_ACLK_MIF1 0x0804
  861. #define ENABLE_ACLK_MIF2 0x0808
  862. #define ENABLE_ACLK_MIF3 0x080c
  863. #define ENABLE_PCLK_MIF 0x0900
  864. #define ENABLE_PCLK_MIF_SECURE_DREX0_TZ 0x0904
  865. #define ENABLE_PCLK_MIF_SECURE_DREX1_TZ 0x0908
  866. #define ENABLE_PCLK_MIF_SECURE_MONOTONIC_CNT 0x090c
  867. #define ENABLE_PCLK_MIF_SECURE_RTC 0x0910
  868. #define ENABLE_SCLK_MIF 0x0a00
  869. #define ENABLE_IP_MIF0 0x0b00
  870. #define ENABLE_IP_MIF1 0x0b04
  871. #define ENABLE_IP_MIF2 0x0b08
  872. #define ENABLE_IP_MIF3 0x0b0c
  873. #define ENABLE_IP_MIF_SECURE_DREX0_TZ 0x0b10
  874. #define ENABLE_IP_MIF_SECURE_DREX1_TZ 0x0b14
  875. #define ENABLE_IP_MIF_SECURE_MONOTONIC_CNT 0x0b18
  876. #define ENABLE_IP_MIF_SECURE_RTC 0x0b1c
  877. #define CLKOUT_CMU_MIF 0x0c00
  878. #define CLKOUT_CMU_MIF_DIV_STAT 0x0c04
  879. #define DREX_FREQ_CTRL0 0x1000
  880. #define DREX_FREQ_CTRL1 0x1004
  881. #define PAUSE 0x1008
  882. #define DDRPHY_LOCK_CTRL 0x100c
  883. static const unsigned long mif_clk_regs[] __initconst = {
  884. MEM0_PLL_LOCK,
  885. MEM1_PLL_LOCK,
  886. BUS_PLL_LOCK,
  887. MFC_PLL_LOCK,
  888. MEM0_PLL_CON0,
  889. MEM0_PLL_CON1,
  890. MEM0_PLL_FREQ_DET,
  891. MEM1_PLL_CON0,
  892. MEM1_PLL_CON1,
  893. MEM1_PLL_FREQ_DET,
  894. BUS_PLL_CON0,
  895. BUS_PLL_CON1,
  896. BUS_PLL_FREQ_DET,
  897. MFC_PLL_CON0,
  898. MFC_PLL_CON1,
  899. MFC_PLL_FREQ_DET,
  900. MUX_SEL_MIF0,
  901. MUX_SEL_MIF1,
  902. MUX_SEL_MIF2,
  903. MUX_SEL_MIF3,
  904. MUX_SEL_MIF4,
  905. MUX_SEL_MIF5,
  906. MUX_SEL_MIF6,
  907. MUX_SEL_MIF7,
  908. MUX_ENABLE_MIF0,
  909. MUX_ENABLE_MIF1,
  910. MUX_ENABLE_MIF2,
  911. MUX_ENABLE_MIF3,
  912. MUX_ENABLE_MIF4,
  913. MUX_ENABLE_MIF5,
  914. MUX_ENABLE_MIF6,
  915. MUX_ENABLE_MIF7,
  916. DIV_MIF1,
  917. DIV_MIF2,
  918. DIV_MIF3,
  919. DIV_MIF4,
  920. DIV_MIF5,
  921. DIV_MIF_PLL_FREQ_DET,
  922. ENABLE_ACLK_MIF0,
  923. ENABLE_ACLK_MIF1,
  924. ENABLE_ACLK_MIF2,
  925. ENABLE_ACLK_MIF3,
  926. ENABLE_PCLK_MIF,
  927. ENABLE_PCLK_MIF_SECURE_DREX0_TZ,
  928. ENABLE_PCLK_MIF_SECURE_DREX1_TZ,
  929. ENABLE_PCLK_MIF_SECURE_MONOTONIC_CNT,
  930. ENABLE_PCLK_MIF_SECURE_RTC,
  931. ENABLE_SCLK_MIF,
  932. ENABLE_IP_MIF0,
  933. ENABLE_IP_MIF1,
  934. ENABLE_IP_MIF2,
  935. ENABLE_IP_MIF3,
  936. ENABLE_IP_MIF_SECURE_DREX0_TZ,
  937. ENABLE_IP_MIF_SECURE_DREX1_TZ,
  938. ENABLE_IP_MIF_SECURE_MONOTONIC_CNT,
  939. ENABLE_IP_MIF_SECURE_RTC,
  940. CLKOUT_CMU_MIF,
  941. CLKOUT_CMU_MIF_DIV_STAT,
  942. DREX_FREQ_CTRL0,
  943. DREX_FREQ_CTRL1,
  944. PAUSE,
  945. DDRPHY_LOCK_CTRL,
  946. };
  947. static const struct samsung_pll_clock mif_pll_clks[] __initconst = {
  948. PLL(pll_35xx, CLK_FOUT_MEM0_PLL, "fout_mem0_pll", "oscclk",
  949. MEM0_PLL_LOCK, MEM0_PLL_CON0, exynos5433_pll_rates),
  950. PLL(pll_35xx, CLK_FOUT_MEM1_PLL, "fout_mem1_pll", "oscclk",
  951. MEM1_PLL_LOCK, MEM1_PLL_CON0, exynos5433_pll_rates),
  952. PLL(pll_35xx, CLK_FOUT_BUS_PLL, "fout_bus_pll", "oscclk",
  953. BUS_PLL_LOCK, BUS_PLL_CON0, exynos5433_pll_rates),
  954. PLL(pll_35xx, CLK_FOUT_MFC_PLL, "fout_mfc_pll", "oscclk",
  955. MFC_PLL_LOCK, MFC_PLL_CON0, exynos5433_pll_rates),
  956. };
  957. /* list of all parent clock list */
  958. PNAME(mout_mfc_pll_div2_p) = { "mout_mfc_pll", "dout_mfc_pll", };
  959. PNAME(mout_bus_pll_div2_p) = { "mout_bus_pll", "dout_bus_pll", };
  960. PNAME(mout_mem1_pll_div2_p) = { "mout_mem1_pll", "dout_mem1_pll", };
  961. PNAME(mout_mem0_pll_div2_p) = { "mout_mem0_pll", "dout_mem0_pll", };
  962. PNAME(mout_mfc_pll_p) = { "oscclk", "fout_mfc_pll", };
  963. PNAME(mout_bus_pll_p) = { "oscclk", "fout_bus_pll", };
  964. PNAME(mout_mem1_pll_p) = { "oscclk", "fout_mem1_pll", };
  965. PNAME(mout_mem0_pll_p) = { "oscclk", "fout_mem0_pll", };
  966. PNAME(mout_clk2x_phy_c_p) = { "mout_mem0_pll_div2", "mout_clkm_phy_b", };
  967. PNAME(mout_clk2x_phy_b_p) = { "mout_bus_pll_div2", "mout_clkm_phy_a", };
  968. PNAME(mout_clk2x_phy_a_p) = { "mout_bus_pll_div2", "mout_mfc_pll_div2", };
  969. PNAME(mout_clkm_phy_b_p) = { "mout_mem1_pll_div2", "mout_clkm_phy_a", };
  970. PNAME(mout_aclk_mifnm_200_p) = { "mout_mem0_pll_div2", "div_mif_pre", };
  971. PNAME(mout_aclk_mifnm_400_p) = { "mout_mem1_pll_div2", "mout_bus_pll_div2",};
  972. PNAME(mout_aclk_disp_333_b_p) = { "mout_aclk_disp_333_a",
  973. "mout_bus_pll_div2", };
  974. PNAME(mout_aclk_disp_333_a_p) = { "mout_mfc_pll_div2", "sclk_mphy_pll", };
  975. PNAME(mout_sclk_decon_vclk_c_p) = { "mout_sclk_decon_vclk_b",
  976. "sclk_mphy_pll", };
  977. PNAME(mout_sclk_decon_vclk_b_p) = { "mout_sclk_decon_vclk_a",
  978. "mout_mfc_pll_div2", };
  979. PNAME(mout_sclk_decon_p) = { "oscclk", "mout_bus_pll_div2", };
  980. PNAME(mout_sclk_decon_eclk_c_p) = { "mout_sclk_decon_eclk_b",
  981. "sclk_mphy_pll", };
  982. PNAME(mout_sclk_decon_eclk_b_p) = { "mout_sclk_decon_eclk_a",
  983. "mout_mfc_pll_div2", };
  984. PNAME(mout_sclk_decon_tv_eclk_c_p) = { "mout_sclk_decon_tv_eclk_b",
  985. "sclk_mphy_pll", };
  986. PNAME(mout_sclk_decon_tv_eclk_b_p) = { "mout_sclk_decon_tv_eclk_a",
  987. "mout_mfc_pll_div2", };
  988. PNAME(mout_sclk_dsd_c_p) = { "mout_sclk_dsd_b", "mout_bus_pll_div2", };
  989. PNAME(mout_sclk_dsd_b_p) = { "mout_sclk_dsd_a", "sclk_mphy_pll", };
  990. PNAME(mout_sclk_dsd_a_p) = { "oscclk", "mout_mfc_pll_div2", };
  991. PNAME(mout_sclk_dsim0_c_p) = { "mout_sclk_dsim0_b", "sclk_mphy_pll", };
  992. PNAME(mout_sclk_dsim0_b_p) = { "mout_sclk_dsim0_a", "mout_mfc_pll_div2" };
  993. PNAME(mout_sclk_decon_tv_vclk_c_p) = { "mout_sclk_decon_tv_vclk_b",
  994. "sclk_mphy_pll", };
  995. PNAME(mout_sclk_decon_tv_vclk_b_p) = { "mout_sclk_decon_tv_vclk_a",
  996. "mout_mfc_pll_div2", };
  997. PNAME(mout_sclk_dsim1_c_p) = { "mout_sclk_dsim1_b", "sclk_mphy_pll", };
  998. PNAME(mout_sclk_dsim1_b_p) = { "mout_sclk_dsim1_a", "mout_mfc_pll_div2",};
  999. static const struct samsung_fixed_factor_clock mif_fixed_factor_clks[] __initconst = {
  1000. /* dout_{mfc|bus|mem1|mem0}_pll is half fixed rate from parent mux */
  1001. FFACTOR(CLK_DOUT_MFC_PLL, "dout_mfc_pll", "mout_mfc_pll", 1, 1, 0),
  1002. FFACTOR(CLK_DOUT_BUS_PLL, "dout_bus_pll", "mout_bus_pll", 1, 1, 0),
  1003. FFACTOR(CLK_DOUT_MEM1_PLL, "dout_mem1_pll", "mout_mem1_pll", 1, 1, 0),
  1004. FFACTOR(CLK_DOUT_MEM0_PLL, "dout_mem0_pll", "mout_mem0_pll", 1, 1, 0),
  1005. };
  1006. static const struct samsung_mux_clock mif_mux_clks[] __initconst = {
  1007. /* MUX_SEL_MIF0 */
  1008. MUX(CLK_MOUT_MFC_PLL_DIV2, "mout_mfc_pll_div2", mout_mfc_pll_div2_p,
  1009. MUX_SEL_MIF0, 28, 1),
  1010. MUX(CLK_MOUT_BUS_PLL_DIV2, "mout_bus_pll_div2", mout_bus_pll_div2_p,
  1011. MUX_SEL_MIF0, 24, 1),
  1012. MUX(CLK_MOUT_MEM1_PLL_DIV2, "mout_mem1_pll_div2", mout_mem1_pll_div2_p,
  1013. MUX_SEL_MIF0, 20, 1),
  1014. MUX(CLK_MOUT_MEM0_PLL_DIV2, "mout_mem0_pll_div2", mout_mem0_pll_div2_p,
  1015. MUX_SEL_MIF0, 16, 1),
  1016. MUX(CLK_MOUT_MFC_PLL, "mout_mfc_pll", mout_mfc_pll_p, MUX_SEL_MIF0,
  1017. 12, 1),
  1018. MUX(CLK_MOUT_BUS_PLL, "mout_bus_pll", mout_bus_pll_p, MUX_SEL_MIF0,
  1019. 8, 1),
  1020. MUX(CLK_MOUT_MEM1_PLL, "mout_mem1_pll", mout_mem1_pll_p, MUX_SEL_MIF0,
  1021. 4, 1),
  1022. MUX(CLK_MOUT_MEM0_PLL, "mout_mem0_pll", mout_mem0_pll_p, MUX_SEL_MIF0,
  1023. 0, 1),
  1024. /* MUX_SEL_MIF1 */
  1025. MUX(CLK_MOUT_CLK2X_PHY_C, "mout_clk2x_phy_c", mout_clk2x_phy_c_p,
  1026. MUX_SEL_MIF1, 24, 1),
  1027. MUX(CLK_MOUT_CLK2X_PHY_B, "mout_clk2x_phy_b", mout_clk2x_phy_b_p,
  1028. MUX_SEL_MIF1, 20, 1),
  1029. MUX(CLK_MOUT_CLK2X_PHY_A, "mout_clk2x_phy_a", mout_clk2x_phy_a_p,
  1030. MUX_SEL_MIF1, 16, 1),
  1031. MUX(CLK_MOUT_CLKM_PHY_C, "mout_clkm_phy_c", mout_clk2x_phy_c_p,
  1032. MUX_SEL_MIF1, 12, 1),
  1033. MUX(CLK_MOUT_CLKM_PHY_B, "mout_clkm_phy_b", mout_clkm_phy_b_p,
  1034. MUX_SEL_MIF1, 8, 1),
  1035. MUX(CLK_MOUT_CLKM_PHY_A, "mout_clkm_phy_a", mout_clk2x_phy_a_p,
  1036. MUX_SEL_MIF1, 4, 1),
  1037. /* MUX_SEL_MIF2 */
  1038. MUX(CLK_MOUT_ACLK_MIFNM_200, "mout_aclk_mifnm_200",
  1039. mout_aclk_mifnm_200_p, MUX_SEL_MIF2, 8, 1),
  1040. MUX(CLK_MOUT_ACLK_MIFNM_400, "mout_aclk_mifnm_400",
  1041. mout_aclk_mifnm_400_p, MUX_SEL_MIF2, 0, 1),
  1042. /* MUX_SEL_MIF3 */
  1043. MUX(CLK_MOUT_ACLK_DISP_333_B, "mout_aclk_disp_333_b",
  1044. mout_aclk_disp_333_b_p, MUX_SEL_MIF3, 4, 1),
  1045. MUX(CLK_MOUT_ACLK_DISP_333_A, "mout_aclk_disp_333_a",
  1046. mout_aclk_disp_333_a_p, MUX_SEL_MIF3, 0, 1),
  1047. /* MUX_SEL_MIF4 */
  1048. MUX(CLK_MOUT_SCLK_DECON_VCLK_C, "mout_sclk_decon_vclk_c",
  1049. mout_sclk_decon_vclk_c_p, MUX_SEL_MIF4, 24, 1),
  1050. MUX(CLK_MOUT_SCLK_DECON_VCLK_B, "mout_sclk_decon_vclk_b",
  1051. mout_sclk_decon_vclk_b_p, MUX_SEL_MIF4, 20, 1),
  1052. MUX(CLK_MOUT_SCLK_DECON_VCLK_A, "mout_sclk_decon_vclk_a",
  1053. mout_sclk_decon_p, MUX_SEL_MIF4, 16, 1),
  1054. MUX(CLK_MOUT_SCLK_DECON_ECLK_C, "mout_sclk_decon_eclk_c",
  1055. mout_sclk_decon_eclk_c_p, MUX_SEL_MIF4, 8, 1),
  1056. MUX(CLK_MOUT_SCLK_DECON_ECLK_B, "mout_sclk_decon_eclk_b",
  1057. mout_sclk_decon_eclk_b_p, MUX_SEL_MIF4, 4, 1),
  1058. MUX(CLK_MOUT_SCLK_DECON_ECLK_A, "mout_sclk_decon_eclk_a",
  1059. mout_sclk_decon_p, MUX_SEL_MIF4, 0, 1),
  1060. /* MUX_SEL_MIF5 */
  1061. MUX(CLK_MOUT_SCLK_DECON_TV_ECLK_C, "mout_sclk_decon_tv_eclk_c",
  1062. mout_sclk_decon_tv_eclk_c_p, MUX_SEL_MIF5, 24, 1),
  1063. MUX(CLK_MOUT_SCLK_DECON_TV_ECLK_B, "mout_sclk_decon_tv_eclk_b",
  1064. mout_sclk_decon_tv_eclk_b_p, MUX_SEL_MIF5, 20, 1),
  1065. MUX(CLK_MOUT_SCLK_DECON_TV_ECLK_A, "mout_sclk_decon_tv_eclk_a",
  1066. mout_sclk_decon_p, MUX_SEL_MIF5, 16, 1),
  1067. MUX(CLK_MOUT_SCLK_DSD_C, "mout_sclk_dsd_c", mout_sclk_dsd_c_p,
  1068. MUX_SEL_MIF5, 8, 1),
  1069. MUX(CLK_MOUT_SCLK_DSD_B, "mout_sclk_dsd_b", mout_sclk_dsd_b_p,
  1070. MUX_SEL_MIF5, 4, 1),
  1071. MUX(CLK_MOUT_SCLK_DSD_A, "mout_sclk_dsd_a", mout_sclk_dsd_a_p,
  1072. MUX_SEL_MIF5, 0, 1),
  1073. /* MUX_SEL_MIF6 */
  1074. MUX(CLK_MOUT_SCLK_DSIM0_C, "mout_sclk_dsim0_c", mout_sclk_dsim0_c_p,
  1075. MUX_SEL_MIF6, 8, 1),
  1076. MUX(CLK_MOUT_SCLK_DSIM0_B, "mout_sclk_dsim0_b", mout_sclk_dsim0_b_p,
  1077. MUX_SEL_MIF6, 4, 1),
  1078. MUX(CLK_MOUT_SCLK_DSIM0_A, "mout_sclk_dsim0_a", mout_sclk_decon_p,
  1079. MUX_SEL_MIF6, 0, 1),
  1080. /* MUX_SEL_MIF7 */
  1081. MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_C, "mout_sclk_decon_tv_vclk_c",
  1082. mout_sclk_decon_tv_vclk_c_p, MUX_SEL_MIF7, 24, 1),
  1083. MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_B, "mout_sclk_decon_tv_vclk_b",
  1084. mout_sclk_decon_tv_vclk_b_p, MUX_SEL_MIF7, 20, 1),
  1085. MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_A, "mout_sclk_decon_tv_vclk_a",
  1086. mout_sclk_decon_p, MUX_SEL_MIF7, 16, 1),
  1087. MUX(CLK_MOUT_SCLK_DSIM1_C, "mout_sclk_dsim1_c", mout_sclk_dsim1_c_p,
  1088. MUX_SEL_MIF7, 8, 1),
  1089. MUX(CLK_MOUT_SCLK_DSIM1_B, "mout_sclk_dsim1_b", mout_sclk_dsim1_b_p,
  1090. MUX_SEL_MIF7, 4, 1),
  1091. MUX(CLK_MOUT_SCLK_DSIM1_A, "mout_sclk_dsim1_a", mout_sclk_decon_p,
  1092. MUX_SEL_MIF7, 0, 1),
  1093. };
  1094. static const struct samsung_div_clock mif_div_clks[] __initconst = {
  1095. /* DIV_MIF1 */
  1096. DIV(CLK_DIV_SCLK_HPM_MIF, "div_sclk_hpm_mif", "div_clk2x_phy",
  1097. DIV_MIF1, 16, 2),
  1098. DIV(CLK_DIV_ACLK_DREX1, "div_aclk_drex1", "div_clk2x_phy", DIV_MIF1,
  1099. 12, 2),
  1100. DIV(CLK_DIV_ACLK_DREX0, "div_aclk_drex0", "div_clk2x_phy", DIV_MIF1,
  1101. 8, 2),
  1102. DIV(CLK_DIV_CLK2XPHY, "div_clk2x_phy", "mout_clk2x_phy_c", DIV_MIF1,
  1103. 4, 4),
  1104. /* DIV_MIF2 */
  1105. DIV(CLK_DIV_ACLK_MIF_266, "div_aclk_mif_266", "mout_bus_pll_div2",
  1106. DIV_MIF2, 20, 3),
  1107. DIV(CLK_DIV_ACLK_MIFND_133, "div_aclk_mifnd_133", "div_mif_pre",
  1108. DIV_MIF2, 16, 4),
  1109. DIV(CLK_DIV_ACLK_MIF_133, "div_aclk_mif_133", "div_mif_pre",
  1110. DIV_MIF2, 12, 4),
  1111. DIV(CLK_DIV_ACLK_MIFNM_200, "div_aclk_mifnm_200",
  1112. "mout_aclk_mifnm_200", DIV_MIF2, 8, 3),
  1113. DIV(CLK_DIV_ACLK_MIF_200, "div_aclk_mif_200", "div_aclk_mif_400",
  1114. DIV_MIF2, 4, 2),
  1115. DIV(CLK_DIV_ACLK_MIF_400, "div_aclk_mif_400", "mout_aclk_mifnm_400",
  1116. DIV_MIF2, 0, 3),
  1117. /* DIV_MIF3 */
  1118. DIV(CLK_DIV_ACLK_BUS2_400, "div_aclk_bus2_400", "div_mif_pre",
  1119. DIV_MIF3, 16, 4),
  1120. DIV(CLK_DIV_ACLK_DISP_333, "div_aclk_disp_333", "mout_aclk_disp_333_b",
  1121. DIV_MIF3, 4, 3),
  1122. DIV(CLK_DIV_ACLK_CPIF_200, "div_aclk_cpif_200", "mout_aclk_mifnm_200",
  1123. DIV_MIF3, 0, 3),
  1124. /* DIV_MIF4 */
  1125. DIV(CLK_DIV_SCLK_DSIM1, "div_sclk_dsim1", "mout_sclk_dsim1_c",
  1126. DIV_MIF4, 24, 4),
  1127. DIV(CLK_DIV_SCLK_DECON_TV_VCLK, "div_sclk_decon_tv_vclk",
  1128. "mout_sclk_decon_tv_vclk_c", DIV_MIF4, 20, 4),
  1129. DIV(CLK_DIV_SCLK_DSIM0, "div_sclk_dsim0", "mout_sclk_dsim0_c",
  1130. DIV_MIF4, 16, 4),
  1131. DIV(CLK_DIV_SCLK_DSD, "div_sclk_dsd", "mout_sclk_dsd_c",
  1132. DIV_MIF4, 12, 4),
  1133. DIV(CLK_DIV_SCLK_DECON_TV_ECLK, "div_sclk_decon_tv_eclk",
  1134. "mout_sclk_decon_tv_eclk_c", DIV_MIF4, 8, 4),
  1135. DIV(CLK_DIV_SCLK_DECON_VCLK, "div_sclk_decon_vclk",
  1136. "mout_sclk_decon_vclk_c", DIV_MIF4, 4, 4),
  1137. DIV(CLK_DIV_SCLK_DECON_ECLK, "div_sclk_decon_eclk",
  1138. "mout_sclk_decon_eclk_c", DIV_MIF4, 0, 4),
  1139. /* DIV_MIF5 */
  1140. DIV(CLK_DIV_MIF_PRE, "div_mif_pre", "mout_bus_pll_div2", DIV_MIF5,
  1141. 0, 3),
  1142. };
  1143. static const struct samsung_gate_clock mif_gate_clks[] __initconst = {
  1144. /* ENABLE_ACLK_MIF0 */
  1145. GATE(CLK_CLK2X_PHY1, "clk2k_phy1", "div_clk2x_phy", ENABLE_ACLK_MIF0,
  1146. 19, CLK_IGNORE_UNUSED, 0),
  1147. GATE(CLK_CLK2X_PHY0, "clk2x_phy0", "div_clk2x_phy", ENABLE_ACLK_MIF0,
  1148. 18, CLK_IGNORE_UNUSED, 0),
  1149. GATE(CLK_CLKM_PHY1, "clkm_phy1", "mout_clkm_phy_c", ENABLE_ACLK_MIF0,
  1150. 17, CLK_IGNORE_UNUSED, 0),
  1151. GATE(CLK_CLKM_PHY0, "clkm_phy0", "mout_clkm_phy_c", ENABLE_ACLK_MIF0,
  1152. 16, CLK_IGNORE_UNUSED, 0),
  1153. GATE(CLK_RCLK_DREX1, "rclk_drex1", "oscclk", ENABLE_ACLK_MIF0,
  1154. 15, CLK_IGNORE_UNUSED, 0),
  1155. GATE(CLK_RCLK_DREX0, "rclk_drex0", "oscclk", ENABLE_ACLK_MIF0,
  1156. 14, CLK_IGNORE_UNUSED, 0),
  1157. GATE(CLK_ACLK_DREX1_TZ, "aclk_drex1_tz", "div_aclk_drex1",
  1158. ENABLE_ACLK_MIF0, 13, CLK_IGNORE_UNUSED, 0),
  1159. GATE(CLK_ACLK_DREX0_TZ, "aclk_drex0_tz", "div_aclk_drex0",
  1160. ENABLE_ACLK_MIF0, 12, CLK_IGNORE_UNUSED, 0),
  1161. GATE(CLK_ACLK_DREX1_PEREV, "aclk_drex1_perev", "div_aclk_drex1",
  1162. ENABLE_ACLK_MIF0, 11, CLK_IGNORE_UNUSED, 0),
  1163. GATE(CLK_ACLK_DREX0_PEREV, "aclk_drex0_perev", "div_aclk_drex0",
  1164. ENABLE_ACLK_MIF0, 10, CLK_IGNORE_UNUSED, 0),
  1165. GATE(CLK_ACLK_DREX1_MEMIF, "aclk_drex1_memif", "div_aclk_drex1",
  1166. ENABLE_ACLK_MIF0, 9, CLK_IGNORE_UNUSED, 0),
  1167. GATE(CLK_ACLK_DREX0_MEMIF, "aclk_drex0_memif", "div_aclk_drex0",
  1168. ENABLE_ACLK_MIF0, 8, CLK_IGNORE_UNUSED, 0),
  1169. GATE(CLK_ACLK_DREX1_SCH, "aclk_drex1_sch", "div_aclk_drex1",
  1170. ENABLE_ACLK_MIF0, 7, CLK_IGNORE_UNUSED, 0),
  1171. GATE(CLK_ACLK_DREX0_SCH, "aclk_drex0_sch", "div_aclk_drex0",
  1172. ENABLE_ACLK_MIF0, 6, CLK_IGNORE_UNUSED, 0),
  1173. GATE(CLK_ACLK_DREX1_BUSIF, "aclk_drex1_busif", "div_aclk_drex1",
  1174. ENABLE_ACLK_MIF0, 5, CLK_IGNORE_UNUSED, 0),
  1175. GATE(CLK_ACLK_DREX0_BUSIF, "aclk_drex0_busif", "div_aclk_drex0",
  1176. ENABLE_ACLK_MIF0, 4, CLK_IGNORE_UNUSED, 0),
  1177. GATE(CLK_ACLK_DREX1_BUSIF_RD, "aclk_drex1_busif_rd", "div_aclk_drex1",
  1178. ENABLE_ACLK_MIF0, 3, CLK_IGNORE_UNUSED, 0),
  1179. GATE(CLK_ACLK_DREX0_BUSIF_RD, "aclk_drex0_busif_rd", "div_aclk_drex0",
  1180. ENABLE_ACLK_MIF0, 2, CLK_IGNORE_UNUSED, 0),
  1181. GATE(CLK_ACLK_DREX1, "aclk_drex1", "div_aclk_drex1",
  1182. ENABLE_ACLK_MIF0, 2, CLK_IGNORE_UNUSED, 0),
  1183. GATE(CLK_ACLK_DREX0, "aclk_drex0", "div_aclk_drex0",
  1184. ENABLE_ACLK_MIF0, 1, CLK_IGNORE_UNUSED, 0),
  1185. /* ENABLE_ACLK_MIF1 */
  1186. GATE(CLK_ACLK_ASYNCAXIS_MIF_IMEM, "aclk_asyncaxis_mif_imem",
  1187. "div_aclk_mif_200", ENABLE_ACLK_MIF1, 28,
  1188. CLK_IGNORE_UNUSED, 0),
  1189. GATE(CLK_ACLK_ASYNCAXIS_NOC_P_CCI, "aclk_asyncaxis_noc_p_cci",
  1190. "div_aclk_mif_200", ENABLE_ACLK_MIF1,
  1191. 27, CLK_IGNORE_UNUSED, 0),
  1192. GATE(CLK_ACLK_ASYNCAXIM_NOC_P_CCI, "aclk_asyncaxim_noc_p_cci",
  1193. "div_aclk_mif_133", ENABLE_ACLK_MIF1,
  1194. 26, CLK_IGNORE_UNUSED, 0),
  1195. GATE(CLK_ACLK_ASYNCAXIS_CP1, "aclk_asyncaxis_cp1",
  1196. "div_aclk_mifnm_200", ENABLE_ACLK_MIF1,
  1197. 25, CLK_IGNORE_UNUSED, 0),
  1198. GATE(CLK_ACLK_ASYNCAXIM_CP1, "aclk_asyncaxim_cp1",
  1199. "div_aclk_drex1", ENABLE_ACLK_MIF1,
  1200. 24, CLK_IGNORE_UNUSED, 0),
  1201. GATE(CLK_ACLK_ASYNCAXIS_CP0, "aclk_asyncaxis_cp0",
  1202. "div_aclk_mifnm_200", ENABLE_ACLK_MIF1,
  1203. 23, CLK_IGNORE_UNUSED, 0),
  1204. GATE(CLK_ACLK_ASYNCAXIM_CP0, "aclk_asyncaxim_cp0",
  1205. "div_aclk_drex0", ENABLE_ACLK_MIF1,
  1206. 22, CLK_IGNORE_UNUSED, 0),
  1207. GATE(CLK_ACLK_ASYNCAXIS_DREX1_3, "aclk_asyncaxis_drex1_3",
  1208. "div_aclk_mif_133", ENABLE_ACLK_MIF1,
  1209. 21, CLK_IGNORE_UNUSED, 0),
  1210. GATE(CLK_ACLK_ASYNCAXIM_DREX1_3, "aclk_asyncaxim_drex1_3",
  1211. "div_aclk_drex1", ENABLE_ACLK_MIF1,
  1212. 20, CLK_IGNORE_UNUSED, 0),
  1213. GATE(CLK_ACLK_ASYNCAXIS_DREX1_1, "aclk_asyncaxis_drex1_1",
  1214. "div_aclk_mif_133", ENABLE_ACLK_MIF1,
  1215. 19, CLK_IGNORE_UNUSED, 0),
  1216. GATE(CLK_ACLK_ASYNCAXIM_DREX1_1, "aclk_asyncaxim_drex1_1",
  1217. "div_aclk_drex1", ENABLE_ACLK_MIF1,
  1218. 18, CLK_IGNORE_UNUSED, 0),
  1219. GATE(CLK_ACLK_ASYNCAXIS_DREX1_0, "aclk_asyncaxis_drex1_0",
  1220. "div_aclk_mif_133", ENABLE_ACLK_MIF1,
  1221. 17, CLK_IGNORE_UNUSED, 0),
  1222. GATE(CLK_ACLK_ASYNCAXIM_DREX1_0, "aclk_asyncaxim_drex1_0",
  1223. "div_aclk_drex1", ENABLE_ACLK_MIF1,
  1224. 16, CLK_IGNORE_UNUSED, 0),
  1225. GATE(CLK_ACLK_ASYNCAXIS_DREX0_3, "aclk_asyncaxis_drex0_3",
  1226. "div_aclk_mif_133", ENABLE_ACLK_MIF1,
  1227. 15, CLK_IGNORE_UNUSED, 0),
  1228. GATE(CLK_ACLK_ASYNCAXIM_DREX0_3, "aclk_asyncaxim_drex0_3",
  1229. "div_aclk_drex0", ENABLE_ACLK_MIF1,
  1230. 14, CLK_IGNORE_UNUSED, 0),
  1231. GATE(CLK_ACLK_ASYNCAXIS_DREX0_1, "aclk_asyncaxis_drex0_1",
  1232. "div_aclk_mif_133", ENABLE_ACLK_MIF1,
  1233. 13, CLK_IGNORE_UNUSED, 0),
  1234. GATE(CLK_ACLK_ASYNCAXIM_DREX0_1, "aclk_asyncaxim_drex0_1",
  1235. "div_aclk_drex0", ENABLE_ACLK_MIF1,
  1236. 12, CLK_IGNORE_UNUSED, 0),
  1237. GATE(CLK_ACLK_ASYNCAXIS_DREX0_0, "aclk_asyncaxis_drex0_0",
  1238. "div_aclk_mif_133", ENABLE_ACLK_MIF1,
  1239. 11, CLK_IGNORE_UNUSED, 0),
  1240. GATE(CLK_ACLK_ASYNCAXIM_DREX0_0, "aclk_asyncaxim_drex0_0",
  1241. "div_aclk_drex0", ENABLE_ACLK_MIF1,
  1242. 10, CLK_IGNORE_UNUSED, 0),
  1243. GATE(CLK_ACLK_AHB2APB_MIF2P, "aclk_ahb2apb_mif2p", "div_aclk_mif_133",
  1244. ENABLE_ACLK_MIF1, 9, CLK_IGNORE_UNUSED, 0),
  1245. GATE(CLK_ACLK_AHB2APB_MIF1P, "aclk_ahb2apb_mif1p", "div_aclk_mif_133",
  1246. ENABLE_ACLK_MIF1, 8, CLK_IGNORE_UNUSED, 0),
  1247. GATE(CLK_ACLK_AHB2APB_MIF0P, "aclk_ahb2apb_mif0p", "div_aclk_mif_133",
  1248. ENABLE_ACLK_MIF1, 7, CLK_IGNORE_UNUSED, 0),
  1249. GATE(CLK_ACLK_IXIU_CCI, "aclk_ixiu_cci", "div_aclk_mif_400",
  1250. ENABLE_ACLK_MIF1, 6, CLK_IGNORE_UNUSED, 0),
  1251. GATE(CLK_ACLK_XIU_MIFSFRX, "aclk_xiu_mifsfrx", "div_aclk_mif_200",
  1252. ENABLE_ACLK_MIF1, 5, CLK_IGNORE_UNUSED, 0),
  1253. GATE(CLK_ACLK_MIFNP_133, "aclk_mifnp_133", "div_aclk_mif_133",
  1254. ENABLE_ACLK_MIF1, 4, CLK_IGNORE_UNUSED, 0),
  1255. GATE(CLK_ACLK_MIFNM_200, "aclk_mifnm_200", "div_aclk_mifnm_200",
  1256. ENABLE_ACLK_MIF1, 3, CLK_IGNORE_UNUSED, 0),
  1257. GATE(CLK_ACLK_MIFND_133, "aclk_mifnd_133", "div_aclk_mifnd_133",
  1258. ENABLE_ACLK_MIF1, 2, CLK_IGNORE_UNUSED, 0),
  1259. GATE(CLK_ACLK_MIFND_400, "aclk_mifnd_400", "div_aclk_mif_400",
  1260. ENABLE_ACLK_MIF1, 1, CLK_IGNORE_UNUSED, 0),
  1261. GATE(CLK_ACLK_CCI, "aclk_cci", "div_aclk_mif_400", ENABLE_ACLK_MIF1,
  1262. 0, CLK_IGNORE_UNUSED, 0),
  1263. /* ENABLE_ACLK_MIF2 */
  1264. GATE(CLK_ACLK_MIFND_266, "aclk_mifnd_266", "div_aclk_mif_266",
  1265. ENABLE_ACLK_MIF2, 20, CLK_IGNORE_UNUSED, 0),
  1266. GATE(CLK_ACLK_PPMU_DREX1S3, "aclk_ppmu_drex1s3", "div_aclk_drex1",
  1267. ENABLE_ACLK_MIF2, 17, CLK_IGNORE_UNUSED, 0),
  1268. GATE(CLK_ACLK_PPMU_DREX1S1, "aclk_ppmu_drex1s1", "div_aclk_drex1",
  1269. ENABLE_ACLK_MIF2, 16, CLK_IGNORE_UNUSED, 0),
  1270. GATE(CLK_ACLK_PPMU_DREX1S0, "aclk_ppmu_drex1s0", "div_aclk_drex1",
  1271. ENABLE_ACLK_MIF2, 15, CLK_IGNORE_UNUSED, 0),
  1272. GATE(CLK_ACLK_PPMU_DREX0S3, "aclk_ppmu_drex0s3", "div_aclk_drex0",
  1273. ENABLE_ACLK_MIF2, 14, CLK_IGNORE_UNUSED, 0),
  1274. GATE(CLK_ACLK_PPMU_DREX0S1, "aclk_ppmu_drex0s1", "div_aclk_drex0",
  1275. ENABLE_ACLK_MIF2, 13, CLK_IGNORE_UNUSED, 0),
  1276. GATE(CLK_ACLK_PPMU_DREX0S0, "aclk_ppmu_drex0s0", "div_aclk_drex0",
  1277. ENABLE_ACLK_MIF2, 12, CLK_IGNORE_UNUSED, 0),
  1278. GATE(CLK_ACLK_AXIDS_CCI_MIFSFRX, "aclk_axids_cci_mifsfrx",
  1279. "div_aclk_mif_200", ENABLE_ACLK_MIF2, 7,
  1280. CLK_IGNORE_UNUSED, 0),
  1281. GATE(CLK_ACLK_AXISYNCDNS_CCI, "aclk_axisyncdns_cci",
  1282. "div_aclk_mif_400", ENABLE_ACLK_MIF2,
  1283. 5, CLK_IGNORE_UNUSED, 0),
  1284. GATE(CLK_ACLK_AXISYNCDN_CCI, "aclk_axisyncdn_cci", "div_aclk_mif_400",
  1285. ENABLE_ACLK_MIF2, 4, CLK_IGNORE_UNUSED, 0),
  1286. GATE(CLK_ACLK_AXISYNCDN_NOC_D, "aclk_axisyncdn_noc_d",
  1287. "div_aclk_mif_200", ENABLE_ACLK_MIF2,
  1288. 3, CLK_IGNORE_UNUSED, 0),
  1289. GATE(CLK_ACLK_ASYNCAPBS_MIF_CSSYS, "aclk_asyncapbs_mif_cssys",
  1290. "div_aclk_mifnd_133", ENABLE_ACLK_MIF2, 0, 0, 0),
  1291. /* ENABLE_ACLK_MIF3 */
  1292. GATE(CLK_ACLK_BUS2_400, "aclk_bus2_400", "div_aclk_bus2_400",
  1293. ENABLE_ACLK_MIF3, 4,
  1294. CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
  1295. GATE(CLK_ACLK_DISP_333, "aclk_disp_333", "div_aclk_disp_333",
  1296. ENABLE_ACLK_MIF3, 1,
  1297. CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
  1298. GATE(CLK_ACLK_CPIF_200, "aclk_cpif_200", "div_aclk_cpif_200",
  1299. ENABLE_ACLK_MIF3, 0,
  1300. CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
  1301. /* ENABLE_PCLK_MIF */
  1302. GATE(CLK_PCLK_PPMU_DREX1S3, "pclk_ppmu_drex1s3", "div_aclk_drex1",
  1303. ENABLE_PCLK_MIF, 29, CLK_IGNORE_UNUSED, 0),
  1304. GATE(CLK_PCLK_PPMU_DREX1S1, "pclk_ppmu_drex1s1", "div_aclk_drex1",
  1305. ENABLE_PCLK_MIF, 28, CLK_IGNORE_UNUSED, 0),
  1306. GATE(CLK_PCLK_PPMU_DREX1S0, "pclk_ppmu_drex1s0", "div_aclk_drex1",
  1307. ENABLE_PCLK_MIF, 27, CLK_IGNORE_UNUSED, 0),
  1308. GATE(CLK_PCLK_PPMU_DREX0S3, "pclk_ppmu_drex0s3", "div_aclk_drex0",
  1309. ENABLE_PCLK_MIF, 26, CLK_IGNORE_UNUSED, 0),
  1310. GATE(CLK_PCLK_PPMU_DREX0S1, "pclk_ppmu_drex0s1", "div_aclk_drex0",
  1311. ENABLE_PCLK_MIF, 25, CLK_IGNORE_UNUSED, 0),
  1312. GATE(CLK_PCLK_PPMU_DREX0S0, "pclk_ppmu_drex0s0", "div_aclk_drex0",
  1313. ENABLE_PCLK_MIF, 24, CLK_IGNORE_UNUSED, 0),
  1314. GATE(CLK_PCLK_ASYNCAXI_NOC_P_CCI, "pclk_asyncaxi_noc_p_cci",
  1315. "div_aclk_mif_133", ENABLE_PCLK_MIF, 21,
  1316. CLK_IGNORE_UNUSED, 0),
  1317. GATE(CLK_PCLK_ASYNCAXI_CP1, "pclk_asyncaxi_cp1", "div_aclk_mif_133",
  1318. ENABLE_PCLK_MIF, 19, 0, 0),
  1319. GATE(CLK_PCLK_ASYNCAXI_CP0, "pclk_asyncaxi_cp0", "div_aclk_mif_133",
  1320. ENABLE_PCLK_MIF, 18, 0, 0),
  1321. GATE(CLK_PCLK_ASYNCAXI_DREX1_3, "pclk_asyncaxi_drex1_3",
  1322. "div_aclk_mif_133", ENABLE_PCLK_MIF, 17, 0, 0),
  1323. GATE(CLK_PCLK_ASYNCAXI_DREX1_1, "pclk_asyncaxi_drex1_1",
  1324. "div_aclk_mif_133", ENABLE_PCLK_MIF, 16, 0, 0),
  1325. GATE(CLK_PCLK_ASYNCAXI_DREX1_0, "pclk_asyncaxi_drex1_0",
  1326. "div_aclk_mif_133", ENABLE_PCLK_MIF, 15, 0, 0),
  1327. GATE(CLK_PCLK_ASYNCAXI_DREX0_3, "pclk_asyncaxi_drex0_3",
  1328. "div_aclk_mif_133", ENABLE_PCLK_MIF, 14, 0, 0),
  1329. GATE(CLK_PCLK_ASYNCAXI_DREX0_1, "pclk_asyncaxi_drex0_1",
  1330. "div_aclk_mif_133", ENABLE_PCLK_MIF, 13, 0, 0),
  1331. GATE(CLK_PCLK_ASYNCAXI_DREX0_0, "pclk_asyncaxi_drex0_0",
  1332. "div_aclk_mif_133", ENABLE_PCLK_MIF, 12, 0, 0),
  1333. GATE(CLK_PCLK_MIFSRVND_133, "pclk_mifsrvnd_133", "div_aclk_mif_133",
  1334. ENABLE_PCLK_MIF, 11, 0, 0),
  1335. GATE(CLK_PCLK_PMU_MIF, "pclk_pmu_mif", "div_aclk_mif_133",
  1336. ENABLE_PCLK_MIF, 10, CLK_IGNORE_UNUSED, 0),
  1337. GATE(CLK_PCLK_SYSREG_MIF, "pclk_sysreg_mif", "div_aclk_mif_133",
  1338. ENABLE_PCLK_MIF, 9, CLK_IGNORE_UNUSED, 0),
  1339. GATE(CLK_PCLK_GPIO_ALIVE, "pclk_gpio_alive", "div_aclk_mif_133",
  1340. ENABLE_PCLK_MIF, 8, CLK_IGNORE_UNUSED, 0),
  1341. GATE(CLK_PCLK_ABB, "pclk_abb", "div_aclk_mif_133",
  1342. ENABLE_PCLK_MIF, 7, 0, 0),
  1343. GATE(CLK_PCLK_PMU_APBIF, "pclk_pmu_apbif", "div_aclk_mif_133",
  1344. ENABLE_PCLK_MIF, 6, CLK_IGNORE_UNUSED, 0),
  1345. GATE(CLK_PCLK_DDR_PHY1, "pclk_ddr_phy1", "div_aclk_mif_133",
  1346. ENABLE_PCLK_MIF, 5, 0, 0),
  1347. GATE(CLK_PCLK_DREX1, "pclk_drex1", "div_aclk_mif_133",
  1348. ENABLE_PCLK_MIF, 3, CLK_IGNORE_UNUSED, 0),
  1349. GATE(CLK_PCLK_DDR_PHY0, "pclk_ddr_phy0", "div_aclk_mif_133",
  1350. ENABLE_PCLK_MIF, 2, 0, 0),
  1351. GATE(CLK_PCLK_DREX0, "pclk_drex0", "div_aclk_mif_133",
  1352. ENABLE_PCLK_MIF, 0, CLK_IGNORE_UNUSED, 0),
  1353. /* ENABLE_PCLK_MIF_SECURE_DREX0_TZ */
  1354. GATE(CLK_PCLK_DREX0_TZ, "pclk_drex0_tz", "div_aclk_mif_133",
  1355. ENABLE_PCLK_MIF_SECURE_DREX0_TZ, 0,
  1356. CLK_IGNORE_UNUSED, 0),
  1357. /* ENABLE_PCLK_MIF_SECURE_DREX1_TZ */
  1358. GATE(CLK_PCLK_DREX1_TZ, "pclk_drex1_tz", "div_aclk_mif_133",
  1359. ENABLE_PCLK_MIF_SECURE_DREX1_TZ, 0,
  1360. CLK_IGNORE_UNUSED, 0),
  1361. /* ENABLE_PCLK_MIF_SECURE_MONOTONIC_CNT */
  1362. GATE(CLK_PCLK_MONOTONIC_CNT, "pclk_monotonic_cnt", "div_aclk_mif_133",
  1363. ENABLE_PCLK_MIF_SECURE_MONOTONIC_CNT, 0, 0, 0),
  1364. /* ENABLE_PCLK_MIF_SECURE_RTC */
  1365. GATE(CLK_PCLK_RTC, "pclk_rtc", "div_aclk_mif_133",
  1366. ENABLE_PCLK_MIF_SECURE_RTC, 0, 0, 0),
  1367. /* ENABLE_SCLK_MIF */
  1368. GATE(CLK_SCLK_DSIM1_DISP, "sclk_dsim1_disp", "div_sclk_dsim1",
  1369. ENABLE_SCLK_MIF, 15, CLK_IGNORE_UNUSED, 0),
  1370. GATE(CLK_SCLK_DECON_TV_VCLK_DISP, "sclk_decon_tv_vclk_disp",
  1371. "div_sclk_decon_tv_vclk", ENABLE_SCLK_MIF,
  1372. 14, CLK_IGNORE_UNUSED, 0),
  1373. GATE(CLK_SCLK_DSIM0_DISP, "sclk_dsim0_disp", "div_sclk_dsim0",
  1374. ENABLE_SCLK_MIF, 9, CLK_IGNORE_UNUSED, 0),
  1375. GATE(CLK_SCLK_DSD_DISP, "sclk_dsd_disp", "div_sclk_dsd",
  1376. ENABLE_SCLK_MIF, 8, CLK_IGNORE_UNUSED, 0),
  1377. GATE(CLK_SCLK_DECON_TV_ECLK_DISP, "sclk_decon_tv_eclk_disp",
  1378. "div_sclk_decon_tv_eclk", ENABLE_SCLK_MIF,
  1379. 7, CLK_IGNORE_UNUSED, 0),
  1380. GATE(CLK_SCLK_DECON_VCLK_DISP, "sclk_decon_vclk_disp",
  1381. "div_sclk_decon_vclk", ENABLE_SCLK_MIF,
  1382. 6, CLK_IGNORE_UNUSED, 0),
  1383. GATE(CLK_SCLK_DECON_ECLK_DISP, "sclk_decon_eclk_disp",
  1384. "div_sclk_decon_eclk", ENABLE_SCLK_MIF,
  1385. 5, CLK_IGNORE_UNUSED, 0),
  1386. GATE(CLK_SCLK_HPM_MIF, "sclk_hpm_mif", "div_sclk_hpm_mif",
  1387. ENABLE_SCLK_MIF, 4,
  1388. CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
  1389. GATE(CLK_SCLK_MFC_PLL, "sclk_mfc_pll", "mout_mfc_pll_div2",
  1390. ENABLE_SCLK_MIF, 3, CLK_IGNORE_UNUSED, 0),
  1391. GATE(CLK_SCLK_BUS_PLL, "sclk_bus_pll", "mout_bus_pll_div2",
  1392. ENABLE_SCLK_MIF, 2, CLK_IGNORE_UNUSED, 0),
  1393. GATE(CLK_SCLK_BUS_PLL_APOLLO, "sclk_bus_pll_apollo", "sclk_bus_pll",
  1394. ENABLE_SCLK_MIF, 1, CLK_IGNORE_UNUSED, 0),
  1395. GATE(CLK_SCLK_BUS_PLL_ATLAS, "sclk_bus_pll_atlas", "sclk_bus_pll",
  1396. ENABLE_SCLK_MIF, 0, CLK_IGNORE_UNUSED, 0),
  1397. };
  1398. static const struct samsung_cmu_info mif_cmu_info __initconst = {
  1399. .pll_clks = mif_pll_clks,
  1400. .nr_pll_clks = ARRAY_SIZE(mif_pll_clks),
  1401. .mux_clks = mif_mux_clks,
  1402. .nr_mux_clks = ARRAY_SIZE(mif_mux_clks),
  1403. .div_clks = mif_div_clks,
  1404. .nr_div_clks = ARRAY_SIZE(mif_div_clks),
  1405. .gate_clks = mif_gate_clks,
  1406. .nr_gate_clks = ARRAY_SIZE(mif_gate_clks),
  1407. .fixed_factor_clks = mif_fixed_factor_clks,
  1408. .nr_fixed_factor_clks = ARRAY_SIZE(mif_fixed_factor_clks),
  1409. .nr_clk_ids = MIF_NR_CLK,
  1410. .clk_regs = mif_clk_regs,
  1411. .nr_clk_regs = ARRAY_SIZE(mif_clk_regs),
  1412. };
  1413. static void __init exynos5433_cmu_mif_init(struct device_node *np)
  1414. {
  1415. samsung_cmu_register_one(np, &mif_cmu_info);
  1416. }
  1417. CLK_OF_DECLARE(exynos5433_cmu_mif, "samsung,exynos5433-cmu-mif",
  1418. exynos5433_cmu_mif_init);
  1419. /*
  1420. * Register offset definitions for CMU_PERIC
  1421. */
  1422. #define DIV_PERIC 0x0600
  1423. #define DIV_STAT_PERIC 0x0700
  1424. #define ENABLE_ACLK_PERIC 0x0800
  1425. #define ENABLE_PCLK_PERIC0 0x0900
  1426. #define ENABLE_PCLK_PERIC1 0x0904
  1427. #define ENABLE_SCLK_PERIC 0x0A00
  1428. #define ENABLE_IP_PERIC0 0x0B00
  1429. #define ENABLE_IP_PERIC1 0x0B04
  1430. #define ENABLE_IP_PERIC2 0x0B08
  1431. static const unsigned long peric_clk_regs[] __initconst = {
  1432. DIV_PERIC,
  1433. ENABLE_ACLK_PERIC,
  1434. ENABLE_PCLK_PERIC0,
  1435. ENABLE_PCLK_PERIC1,
  1436. ENABLE_SCLK_PERIC,
  1437. ENABLE_IP_PERIC0,
  1438. ENABLE_IP_PERIC1,
  1439. ENABLE_IP_PERIC2,
  1440. };
  1441. static const struct samsung_div_clock peric_div_clks[] __initconst = {
  1442. /* DIV_PERIC */
  1443. DIV(CLK_DIV_SCLK_SCI, "div_sclk_sci", "oscclk", DIV_PERIC, 4, 4),
  1444. DIV(CLK_DIV_SCLK_SC_IN, "div_sclk_sc_in", "oscclk", DIV_PERIC, 0, 4),
  1445. };
  1446. static const struct samsung_gate_clock peric_gate_clks[] __initconst = {
  1447. /* ENABLE_ACLK_PERIC */
  1448. GATE(CLK_ACLK_AHB2APB_PERIC2P, "aclk_ahb2apb_peric2p", "aclk_peric_66",
  1449. ENABLE_ACLK_PERIC, 3, CLK_IGNORE_UNUSED, 0),
  1450. GATE(CLK_ACLK_AHB2APB_PERIC1P, "aclk_ahb2apb_peric1p", "aclk_peric_66",
  1451. ENABLE_ACLK_PERIC, 2, CLK_IGNORE_UNUSED, 0),
  1452. GATE(CLK_ACLK_AHB2APB_PERIC0P, "aclk_ahb2apb_peric0p", "aclk_peric_66",
  1453. ENABLE_ACLK_PERIC, 1, CLK_IGNORE_UNUSED, 0),
  1454. GATE(CLK_ACLK_PERICNP_66, "aclk_pericnp_66", "aclk_peric_66",
  1455. ENABLE_ACLK_PERIC, 0, CLK_IGNORE_UNUSED, 0),
  1456. /* ENABLE_PCLK_PERIC0 */
  1457. GATE(CLK_PCLK_SCI, "pclk_sci", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1458. 31, CLK_SET_RATE_PARENT, 0),
  1459. GATE(CLK_PCLK_GPIO_FINGER, "pclk_gpio_finger", "aclk_peric_66",
  1460. ENABLE_PCLK_PERIC0, 30, CLK_IGNORE_UNUSED, 0),
  1461. GATE(CLK_PCLK_GPIO_ESE, "pclk_gpio_ese", "aclk_peric_66",
  1462. ENABLE_PCLK_PERIC0, 29, CLK_IGNORE_UNUSED, 0),
  1463. GATE(CLK_PCLK_PWM, "pclk_pwm", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1464. 28, CLK_SET_RATE_PARENT, 0),
  1465. GATE(CLK_PCLK_SPDIF, "pclk_spdif", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1466. 26, CLK_SET_RATE_PARENT, 0),
  1467. GATE(CLK_PCLK_PCM1, "pclk_pcm1", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1468. 25, CLK_SET_RATE_PARENT, 0),
  1469. GATE(CLK_PCLK_I2S1, "pclk_i2s", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1470. 24, CLK_SET_RATE_PARENT, 0),
  1471. GATE(CLK_PCLK_SPI2, "pclk_spi2", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1472. 23, CLK_SET_RATE_PARENT, 0),
  1473. GATE(CLK_PCLK_SPI1, "pclk_spi1", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1474. 22, CLK_SET_RATE_PARENT, 0),
  1475. GATE(CLK_PCLK_SPI0, "pclk_spi0", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1476. 21, CLK_SET_RATE_PARENT, 0),
  1477. GATE(CLK_PCLK_ADCIF, "pclk_adcif", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1478. 20, CLK_SET_RATE_PARENT, 0),
  1479. GATE(CLK_PCLK_GPIO_TOUCH, "pclk_gpio_touch", "aclk_peric_66",
  1480. ENABLE_PCLK_PERIC0, 19, CLK_IGNORE_UNUSED, 0),
  1481. GATE(CLK_PCLK_GPIO_NFC, "pclk_gpio_nfc", "aclk_peric_66",
  1482. ENABLE_PCLK_PERIC0, 18, CLK_IGNORE_UNUSED, 0),
  1483. GATE(CLK_PCLK_GPIO_PERIC, "pclk_gpio_peric", "aclk_peric_66",
  1484. ENABLE_PCLK_PERIC0, 17, CLK_IGNORE_UNUSED, 0),
  1485. GATE(CLK_PCLK_PMU_PERIC, "pclk_pmu_peric", "aclk_peric_66",
  1486. ENABLE_PCLK_PERIC0, 16, CLK_SET_RATE_PARENT, 0),
  1487. GATE(CLK_PCLK_SYSREG_PERIC, "pclk_sysreg_peric", "aclk_peric_66",
  1488. ENABLE_PCLK_PERIC0, 15,
  1489. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  1490. GATE(CLK_PCLK_UART2, "pclk_uart2", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1491. 14, CLK_SET_RATE_PARENT, 0),
  1492. GATE(CLK_PCLK_UART1, "pclk_uart1", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1493. 13, CLK_SET_RATE_PARENT, 0),
  1494. GATE(CLK_PCLK_UART0, "pclk_uart0", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1495. 12, CLK_SET_RATE_PARENT, 0),
  1496. GATE(CLK_PCLK_HSI2C3, "pclk_hsi2c3", "aclk_peric_66",
  1497. ENABLE_PCLK_PERIC0, 11, CLK_SET_RATE_PARENT, 0),
  1498. GATE(CLK_PCLK_HSI2C2, "pclk_hsi2c2", "aclk_peric_66",
  1499. ENABLE_PCLK_PERIC0, 10, CLK_SET_RATE_PARENT, 0),
  1500. GATE(CLK_PCLK_HSI2C1, "pclk_hsi2c1", "aclk_peric_66",
  1501. ENABLE_PCLK_PERIC0, 9, CLK_SET_RATE_PARENT, 0),
  1502. GATE(CLK_PCLK_HSI2C0, "pclk_hsi2c0", "aclk_peric_66",
  1503. ENABLE_PCLK_PERIC0, 8, CLK_SET_RATE_PARENT, 0),
  1504. GATE(CLK_PCLK_I2C7, "pclk_i2c7", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1505. 7, CLK_SET_RATE_PARENT, 0),
  1506. GATE(CLK_PCLK_I2C6, "pclk_i2c6", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1507. 6, CLK_SET_RATE_PARENT, 0),
  1508. GATE(CLK_PCLK_I2C5, "pclk_i2c5", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1509. 5, CLK_SET_RATE_PARENT, 0),
  1510. GATE(CLK_PCLK_I2C4, "pclk_i2c4", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1511. 4, CLK_SET_RATE_PARENT, 0),
  1512. GATE(CLK_PCLK_I2C3, "pclk_i2c3", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1513. 3, CLK_SET_RATE_PARENT, 0),
  1514. GATE(CLK_PCLK_I2C2, "pclk_i2c2", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1515. 2, CLK_SET_RATE_PARENT, 0),
  1516. GATE(CLK_PCLK_I2C1, "pclk_i2c1", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1517. 1, CLK_SET_RATE_PARENT, 0),
  1518. GATE(CLK_PCLK_I2C0, "pclk_i2c0", "aclk_peric_66", ENABLE_PCLK_PERIC0,
  1519. 0, CLK_SET_RATE_PARENT, 0),
  1520. /* ENABLE_PCLK_PERIC1 */
  1521. GATE(CLK_PCLK_SPI4, "pclk_spi4", "aclk_peric_66", ENABLE_PCLK_PERIC1,
  1522. 9, CLK_SET_RATE_PARENT, 0),
  1523. GATE(CLK_PCLK_SPI3, "pclk_spi3", "aclk_peric_66", ENABLE_PCLK_PERIC1,
  1524. 8, CLK_SET_RATE_PARENT, 0),
  1525. GATE(CLK_PCLK_HSI2C11, "pclk_hsi2c11", "aclk_peric_66",
  1526. ENABLE_PCLK_PERIC1, 7, CLK_SET_RATE_PARENT, 0),
  1527. GATE(CLK_PCLK_HSI2C10, "pclk_hsi2c10", "aclk_peric_66",
  1528. ENABLE_PCLK_PERIC1, 6, CLK_SET_RATE_PARENT, 0),
  1529. GATE(CLK_PCLK_HSI2C9, "pclk_hsi2c9", "aclk_peric_66",
  1530. ENABLE_PCLK_PERIC1, 5, CLK_SET_RATE_PARENT, 0),
  1531. GATE(CLK_PCLK_HSI2C8, "pclk_hsi2c8", "aclk_peric_66",
  1532. ENABLE_PCLK_PERIC1, 4, CLK_SET_RATE_PARENT, 0),
  1533. GATE(CLK_PCLK_HSI2C7, "pclk_hsi2c7", "aclk_peric_66",
  1534. ENABLE_PCLK_PERIC1, 3, CLK_SET_RATE_PARENT, 0),
  1535. GATE(CLK_PCLK_HSI2C6, "pclk_hsi2c6", "aclk_peric_66",
  1536. ENABLE_PCLK_PERIC1, 2, CLK_SET_RATE_PARENT, 0),
  1537. GATE(CLK_PCLK_HSI2C5, "pclk_hsi2c5", "aclk_peric_66",
  1538. ENABLE_PCLK_PERIC1, 1, CLK_SET_RATE_PARENT, 0),
  1539. GATE(CLK_PCLK_HSI2C4, "pclk_hsi2c4", "aclk_peric_66",
  1540. ENABLE_PCLK_PERIC1, 0, CLK_SET_RATE_PARENT, 0),
  1541. /* ENABLE_SCLK_PERIC */
  1542. GATE(CLK_SCLK_IOCLK_SPI4, "sclk_ioclk_spi4", "ioclk_spi4_clk_in",
  1543. ENABLE_SCLK_PERIC, 21, CLK_SET_RATE_PARENT, 0),
  1544. GATE(CLK_SCLK_IOCLK_SPI3, "sclk_ioclk_spi3", "ioclk_spi3_clk_in",
  1545. ENABLE_SCLK_PERIC, 20, CLK_SET_RATE_PARENT, 0),
  1546. GATE(CLK_SCLK_SPI4, "sclk_spi4", "sclk_spi4_peric", ENABLE_SCLK_PERIC,
  1547. 19, CLK_SET_RATE_PARENT, 0),
  1548. GATE(CLK_SCLK_SPI3, "sclk_spi3", "sclk_spi3_peric", ENABLE_SCLK_PERIC,
  1549. 18, CLK_SET_RATE_PARENT, 0),
  1550. GATE(CLK_SCLK_SCI, "sclk_sci", "div_sclk_sci", ENABLE_SCLK_PERIC,
  1551. 17, 0, 0),
  1552. GATE(CLK_SCLK_SC_IN, "sclk_sc_in", "div_sclk_sc_in", ENABLE_SCLK_PERIC,
  1553. 16, 0, 0),
  1554. GATE(CLK_SCLK_PWM, "sclk_pwm", "oscclk", ENABLE_SCLK_PERIC, 15, 0, 0),
  1555. GATE(CLK_SCLK_IOCLK_SPI2, "sclk_ioclk_spi2", "ioclk_spi2_clk_in",
  1556. ENABLE_SCLK_PERIC, 13, CLK_SET_RATE_PARENT, 0),
  1557. GATE(CLK_SCLK_IOCLK_SPI1, "sclk_ioclk_spi1", "ioclk_spi1_clk_in",
  1558. ENABLE_SCLK_PERIC, 12, CLK_SET_RATE_PARENT, 0),
  1559. GATE(CLK_SCLK_IOCLK_SPI0, "sclk_ioclk_spi0", "ioclk_spi0_clk_in",
  1560. ENABLE_SCLK_PERIC, 11, CLK_SET_RATE_PARENT, 0),
  1561. GATE(CLK_SCLK_IOCLK_I2S1_BCLK, "sclk_ioclk_i2s1_bclk",
  1562. "ioclk_i2s1_bclk_in", ENABLE_SCLK_PERIC, 10,
  1563. CLK_SET_RATE_PARENT, 0),
  1564. GATE(CLK_SCLK_SPDIF, "sclk_spdif", "sclk_spdif_peric",
  1565. ENABLE_SCLK_PERIC, 8, CLK_SET_RATE_PARENT, 0),
  1566. GATE(CLK_SCLK_PCM1, "sclk_pcm1", "sclk_pcm1_peric",
  1567. ENABLE_SCLK_PERIC, 7, CLK_SET_RATE_PARENT, 0),
  1568. GATE(CLK_SCLK_I2S1, "sclk_i2s1", "sclk_i2s1_peric",
  1569. ENABLE_SCLK_PERIC, 6,
  1570. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  1571. GATE(CLK_SCLK_SPI2, "sclk_spi2", "sclk_spi2_peric", ENABLE_SCLK_PERIC,
  1572. 5, CLK_SET_RATE_PARENT, 0),
  1573. GATE(CLK_SCLK_SPI1, "sclk_spi1", "sclk_spi1_peric", ENABLE_SCLK_PERIC,
  1574. 4, CLK_SET_RATE_PARENT, 0),
  1575. GATE(CLK_SCLK_SPI0, "sclk_spi0", "sclk_spi0_peric", ENABLE_SCLK_PERIC,
  1576. 3, CLK_SET_RATE_PARENT, 0),
  1577. GATE(CLK_SCLK_UART2, "sclk_uart2", "sclk_uart2_peric",
  1578. ENABLE_SCLK_PERIC, 2,
  1579. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  1580. GATE(CLK_SCLK_UART1, "sclk_uart1", "sclk_uart1_peric",
  1581. ENABLE_SCLK_PERIC, 1,
  1582. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  1583. GATE(CLK_SCLK_UART0, "sclk_uart0", "sclk_uart0_peric",
  1584. ENABLE_SCLK_PERIC, 0,
  1585. CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
  1586. };
  1587. static const struct samsung_cmu_info peric_cmu_info __initconst = {
  1588. .div_clks = peric_div_clks,
  1589. .nr_div_clks = ARRAY_SIZE(peric_div_clks),
  1590. .gate_clks = peric_gate_clks,
  1591. .nr_gate_clks = ARRAY_SIZE(peric_gate_clks),
  1592. .nr_clk_ids = PERIC_NR_CLK,
  1593. .clk_regs = peric_clk_regs,
  1594. .nr_clk_regs = ARRAY_SIZE(peric_clk_regs),
  1595. };
  1596. static void __init exynos5433_cmu_peric_init(struct device_node *np)
  1597. {
  1598. samsung_cmu_register_one(np, &peric_cmu_info);
  1599. }
  1600. CLK_OF_DECLARE(exynos5433_cmu_peric, "samsung,exynos5433-cmu-peric",
  1601. exynos5433_cmu_peric_init);
  1602. /*
  1603. * Register offset definitions for CMU_PERIS
  1604. */
  1605. #define ENABLE_ACLK_PERIS 0x0800
  1606. #define ENABLE_PCLK_PERIS 0x0900
  1607. #define ENABLE_PCLK_PERIS_SECURE_TZPC 0x0904
  1608. #define ENABLE_PCLK_PERIS_SECURE_SECKEY_APBIF 0x0908
  1609. #define ENABLE_PCLK_PERIS_SECURE_CHIPID_APBIF 0x090c
  1610. #define ENABLE_PCLK_PERIS_SECURE_TOPRTC 0x0910
  1611. #define ENABLE_PCLK_PERIS_SECURE_CUSTOM_EFUSE_APBIF 0x0914
  1612. #define ENABLE_PCLK_PERIS_SECURE_ANTIRBK_CNT_APBIF 0x0918
  1613. #define ENABLE_PCLK_PERIS_SECURE_OTP_CON_APBIF 0x091c
  1614. #define ENABLE_SCLK_PERIS 0x0a00
  1615. #define ENABLE_SCLK_PERIS_SECURE_SECKEY 0x0a04
  1616. #define ENABLE_SCLK_PERIS_SECURE_CHIPID 0x0a08
  1617. #define ENABLE_SCLK_PERIS_SECURE_TOPRTC 0x0a0c
  1618. #define ENABLE_SCLK_PERIS_SECURE_CUSTOM_EFUSE 0x0a10
  1619. #define ENABLE_SCLK_PERIS_SECURE_ANTIRBK_CNT 0x0a14
  1620. #define ENABLE_SCLK_PERIS_SECURE_OTP_CON 0x0a18
  1621. #define ENABLE_IP_PERIS0 0x0b00
  1622. #define ENABLE_IP_PERIS1 0x0b04
  1623. #define ENABLE_IP_PERIS_SECURE_TZPC 0x0b08
  1624. #define ENABLE_IP_PERIS_SECURE_SECKEY 0x0b0c
  1625. #define ENABLE_IP_PERIS_SECURE_CHIPID 0x0b10
  1626. #define ENABLE_IP_PERIS_SECURE_TOPRTC 0x0b14
  1627. #define ENABLE_IP_PERIS_SECURE_CUSTOM_EFUSE 0x0b18
  1628. #define ENABLE_IP_PERIS_SECURE_ANTIBRK_CNT 0x0b1c
  1629. #define ENABLE_IP_PERIS_SECURE_OTP_CON 0x0b20
  1630. static const unsigned long peris_clk_regs[] __initconst = {
  1631. ENABLE_ACLK_PERIS,
  1632. ENABLE_PCLK_PERIS,
  1633. ENABLE_PCLK_PERIS_SECURE_TZPC,
  1634. ENABLE_PCLK_PERIS_SECURE_SECKEY_APBIF,
  1635. ENABLE_PCLK_PERIS_SECURE_CHIPID_APBIF,
  1636. ENABLE_PCLK_PERIS_SECURE_TOPRTC,
  1637. ENABLE_PCLK_PERIS_SECURE_CUSTOM_EFUSE_APBIF,
  1638. ENABLE_PCLK_PERIS_SECURE_ANTIRBK_CNT_APBIF,
  1639. ENABLE_PCLK_PERIS_SECURE_OTP_CON_APBIF,
  1640. ENABLE_SCLK_PERIS,
  1641. ENABLE_SCLK_PERIS_SECURE_SECKEY,
  1642. ENABLE_SCLK_PERIS_SECURE_CHIPID,
  1643. ENABLE_SCLK_PERIS_SECURE_TOPRTC,
  1644. ENABLE_SCLK_PERIS_SECURE_CUSTOM_EFUSE,
  1645. ENABLE_SCLK_PERIS_SECURE_ANTIRBK_CNT,
  1646. ENABLE_SCLK_PERIS_SECURE_OTP_CON,
  1647. ENABLE_IP_PERIS0,
  1648. ENABLE_IP_PERIS1,
  1649. ENABLE_IP_PERIS_SECURE_TZPC,
  1650. ENABLE_IP_PERIS_SECURE_SECKEY,
  1651. ENABLE_IP_PERIS_SECURE_CHIPID,
  1652. ENABLE_IP_PERIS_SECURE_TOPRTC,
  1653. ENABLE_IP_PERIS_SECURE_CUSTOM_EFUSE,
  1654. ENABLE_IP_PERIS_SECURE_ANTIBRK_CNT,
  1655. ENABLE_IP_PERIS_SECURE_OTP_CON,
  1656. };
  1657. static const struct samsung_gate_clock peris_gate_clks[] __initconst = {
  1658. /* ENABLE_ACLK_PERIS */
  1659. GATE(CLK_ACLK_AHB2APB_PERIS1P, "aclk_ahb2apb_peris1p", "aclk_peris_66",
  1660. ENABLE_ACLK_PERIS, 2, CLK_IGNORE_UNUSED, 0),
  1661. GATE(CLK_ACLK_AHB2APB_PERIS0P, "aclk_ahb2apb_peris0p", "aclk_peris_66",
  1662. ENABLE_ACLK_PERIS, 1, CLK_IGNORE_UNUSED, 0),
  1663. GATE(CLK_ACLK_PERISNP_66, "aclk_perisnp_66", "aclk_peris_66",
  1664. ENABLE_ACLK_PERIS, 0, CLK_IGNORE_UNUSED, 0),
  1665. /* ENABLE_PCLK_PERIS */
  1666. GATE(CLK_PCLK_HPM_APBIF, "pclk_hpm_apbif", "aclk_peris_66",
  1667. ENABLE_PCLK_PERIS, 30, CLK_IGNORE_UNUSED, 0),
  1668. GATE(CLK_PCLK_TMU1_APBIF, "pclk_tmu1_apbif", "aclk_peris_66",
  1669. ENABLE_PCLK_PERIS, 24, CLK_IGNORE_UNUSED, 0),
  1670. GATE(CLK_PCLK_TMU0_APBIF, "pclk_tmu0_apbif", "aclk_peris_66",
  1671. ENABLE_PCLK_PERIS, 23, CLK_IGNORE_UNUSED, 0),
  1672. GATE(CLK_PCLK_PMU_PERIS, "pclk_pmu_peris", "aclk_peris_66",
  1673. ENABLE_PCLK_PERIS, 22, CLK_IGNORE_UNUSED, 0),
  1674. GATE(CLK_PCLK_SYSREG_PERIS, "pclk_sysreg_peris", "aclk_peris_66",
  1675. ENABLE_PCLK_PERIS, 21, CLK_IGNORE_UNUSED, 0),
  1676. GATE(CLK_PCLK_CMU_TOP_APBIF, "pclk_cmu_top_apbif", "aclk_peris_66",
  1677. ENABLE_PCLK_PERIS, 20, CLK_IGNORE_UNUSED, 0),
  1678. GATE(CLK_PCLK_WDT_APOLLO, "pclk_wdt_apollo", "aclk_peris_66",
  1679. ENABLE_PCLK_PERIS, 17, CLK_IGNORE_UNUSED, 0),
  1680. GATE(CLK_PCLK_WDT_ATLAS, "pclk_wdt_atlas", "aclk_peris_66",
  1681. ENABLE_PCLK_PERIS, 16, CLK_IGNORE_UNUSED, 0),
  1682. GATE(CLK_PCLK_MCT, "pclk_mct", "aclk_peris_66",
  1683. ENABLE_PCLK_PERIS, 15, CLK_IGNORE_UNUSED, 0),
  1684. GATE(CLK_PCLK_HDMI_CEC, "pclk_hdmi_cec", "aclk_peris_66",
  1685. ENABLE_PCLK_PERIS, 14, CLK_IGNORE_UNUSED, 0),
  1686. /* ENABLE_PCLK_PERIS_SECURE_TZPC */
  1687. GATE(CLK_PCLK_TZPC12, "pclk_tzpc12", "aclk_peris_66",
  1688. ENABLE_PCLK_PERIS_SECURE_TZPC, 12, CLK_IGNORE_UNUSED, 0),
  1689. GATE(CLK_PCLK_TZPC11, "pclk_tzpc11", "aclk_peris_66",
  1690. ENABLE_PCLK_PERIS_SECURE_TZPC, 11, CLK_IGNORE_UNUSED, 0),
  1691. GATE(CLK_PCLK_TZPC10, "pclk_tzpc10", "aclk_peris_66",
  1692. ENABLE_PCLK_PERIS_SECURE_TZPC, 10, CLK_IGNORE_UNUSED, 0),
  1693. GATE(CLK_PCLK_TZPC9, "pclk_tzpc9", "aclk_peris_66",
  1694. ENABLE_PCLK_PERIS_SECURE_TZPC, 9, CLK_IGNORE_UNUSED, 0),
  1695. GATE(CLK_PCLK_TZPC8, "pclk_tzpc8", "aclk_peris_66",
  1696. ENABLE_PCLK_PERIS_SECURE_TZPC, 8, CLK_IGNORE_UNUSED, 0),
  1697. GATE(CLK_PCLK_TZPC7, "pclk_tzpc7", "aclk_peris_66",
  1698. ENABLE_PCLK_PERIS_SECURE_TZPC, 7, CLK_IGNORE_UNUSED, 0),
  1699. GATE(CLK_PCLK_TZPC6, "pclk_tzpc6", "aclk_peris_66",
  1700. ENABLE_PCLK_PERIS_SECURE_TZPC, 6, CLK_IGNORE_UNUSED, 0),
  1701. GATE(CLK_PCLK_TZPC5, "pclk_tzpc5", "aclk_peris_66",
  1702. ENABLE_PCLK_PERIS_SECURE_TZPC, 5, CLK_IGNORE_UNUSED, 0),
  1703. GATE(CLK_PCLK_TZPC4, "pclk_tzpc4", "aclk_peris_66",
  1704. ENABLE_PCLK_PERIS_SECURE_TZPC, 4, CLK_IGNORE_UNUSED, 0),
  1705. GATE(CLK_PCLK_TZPC3, "pclk_tzpc3", "aclk_peris_66",
  1706. ENABLE_PCLK_PERIS_SECURE_TZPC, 3, CLK_IGNORE_UNUSED, 0),
  1707. GATE(CLK_PCLK_TZPC2, "pclk_tzpc2", "aclk_peris_66",
  1708. ENABLE_PCLK_PERIS_SECURE_TZPC, 2, CLK_IGNORE_UNUSED, 0),
  1709. GATE(CLK_PCLK_TZPC1, "pclk_tzpc1", "aclk_peris_66",
  1710. ENABLE_PCLK_PERIS_SECURE_TZPC, 1, CLK_IGNORE_UNUSED, 0),
  1711. GATE(CLK_PCLK_TZPC0, "pclk_tzpc0", "aclk_peris_66",
  1712. ENABLE_PCLK_PERIS_SECURE_TZPC, 0, CLK_IGNORE_UNUSED, 0),
  1713. /* ENABLE_PCLK_PERIS_SECURE_SECKEY_APBIF */
  1714. GATE(CLK_PCLK_SECKEY_APBIF, "pclk_seckey_apbif", "aclk_peris_66",
  1715. ENABLE_PCLK_PERIS_SECURE_SECKEY_APBIF, 0, CLK_IGNORE_UNUSED, 0),
  1716. /* ENABLE_PCLK_PERIS_SECURE_CHIPID_APBIF */
  1717. GATE(CLK_PCLK_CHIPID_APBIF, "pclk_chipid_apbif", "aclk_peris_66",
  1718. ENABLE_PCLK_PERIS_SECURE_CHIPID_APBIF, 0, CLK_IGNORE_UNUSED, 0),
  1719. /* ENABLE_PCLK_PERIS_SECURE_TOPRTC */
  1720. GATE(CLK_PCLK_TOPRTC, "pclk_toprtc", "aclk_peris_66",
  1721. ENABLE_PCLK_PERIS_SECURE_TOPRTC, 0, 0, 0),
  1722. /* ENABLE_PCLK_PERIS_SECURE_CUSTOM_EFUSE_APBIF */
  1723. GATE(CLK_PCLK_CUSTOM_EFUSE_APBIF, "pclk_custom_efuse_apbif",
  1724. "aclk_peris_66",
  1725. ENABLE_PCLK_PERIS_SECURE_CUSTOM_EFUSE_APBIF, 0, 0, 0),
  1726. /* ENABLE_PCLK_PERIS_SECURE_ANTIRBK_CNT_APBIF */
  1727. GATE(CLK_PCLK_ANTIRBK_CNT_APBIF, "pclk_antirbk_cnt_apbif",
  1728. "aclk_peris_66",
  1729. ENABLE_PCLK_PERIS_SECURE_ANTIRBK_CNT_APBIF, 0, 0, 0),
  1730. /* ENABLE_PCLK_PERIS_SECURE_OTP_CON_APBIF */
  1731. GATE(CLK_PCLK_OTP_CON_APBIF, "pclk_otp_con_apbif",
  1732. "aclk_peris_66",
  1733. ENABLE_PCLK_PERIS_SECURE_OTP_CON_APBIF, 0, 0, 0),
  1734. /* ENABLE_SCLK_PERIS */
  1735. GATE(CLK_SCLK_ASV_TB, "sclk_asv_tb", "oscclk_efuse_common",
  1736. ENABLE_SCLK_PERIS, 10, 0, 0),
  1737. GATE(CLK_SCLK_TMU1, "sclk_tmu1", "oscclk_efuse_common",
  1738. ENABLE_SCLK_PERIS, 4, 0, 0),
  1739. GATE(CLK_SCLK_TMU0, "sclk_tmu0", "oscclk_efuse_common",
  1740. ENABLE_SCLK_PERIS, 3, 0, 0),
  1741. /* ENABLE_SCLK_PERIS_SECURE_SECKEY */
  1742. GATE(CLK_SCLK_SECKEY, "sclk_seckey", "oscclk_efuse_common",
  1743. ENABLE_SCLK_PERIS_SECURE_SECKEY, 0, CLK_IGNORE_UNUSED, 0),
  1744. /* ENABLE_SCLK_PERIS_SECURE_CHIPID */
  1745. GATE(CLK_SCLK_CHIPID, "sclk_chipid", "oscclk_efuse_common",
  1746. ENABLE_SCLK_PERIS_SECURE_CHIPID, 0, CLK_IGNORE_UNUSED, 0),
  1747. /* ENABLE_SCLK_PERIS_SECURE_TOPRTC */
  1748. GATE(CLK_SCLK_TOPRTC, "sclk_toprtc", "oscclk_efuse_common",
  1749. ENABLE_SCLK_PERIS_SECURE_TOPRTC, 0, 0, 0),
  1750. /* ENABLE_SCLK_PERIS_SECURE_CUSTOM_EFUSE */
  1751. GATE(CLK_SCLK_CUSTOM_EFUSE, "sclk_custom_efuse", "oscclk_efuse_common",
  1752. ENABLE_SCLK_PERIS_SECURE_CUSTOM_EFUSE, 0, 0, 0),
  1753. /* ENABLE_SCLK_PERIS_SECURE_ANTIRBK_CNT */
  1754. GATE(CLK_SCLK_ANTIRBK_CNT, "sclk_antirbk_cnt", "oscclk_efuse_common",
  1755. ENABLE_SCLK_PERIS_SECURE_ANTIRBK_CNT, 0, 0, 0),
  1756. /* ENABLE_SCLK_PERIS_SECURE_OTP_CON */
  1757. GATE(CLK_SCLK_OTP_CON, "sclk_otp_con", "oscclk_efuse_common",
  1758. ENABLE_SCLK_PERIS_SECURE_OTP_CON, 0, 0, 0),
  1759. };
  1760. static const struct samsung_cmu_info peris_cmu_info __initconst = {
  1761. .gate_clks = peris_gate_clks,
  1762. .nr_gate_clks = ARRAY_SIZE(peris_gate_clks),
  1763. .nr_clk_ids = PERIS_NR_CLK,
  1764. .clk_regs = peris_clk_regs,
  1765. .nr_clk_regs = ARRAY_SIZE(peris_clk_regs),
  1766. };
  1767. static void __init exynos5433_cmu_peris_init(struct device_node *np)
  1768. {
  1769. samsung_cmu_register_one(np, &peris_cmu_info);
  1770. }
  1771. CLK_OF_DECLARE(exynos5433_cmu_peris, "samsung,exynos5433-cmu-peris",
  1772. exynos5433_cmu_peris_init);
  1773. /*
  1774. * Register offset definitions for CMU_FSYS
  1775. */
  1776. #define MUX_SEL_FSYS0 0x0200
  1777. #define MUX_SEL_FSYS1 0x0204
  1778. #define MUX_SEL_FSYS2 0x0208
  1779. #define MUX_SEL_FSYS3 0x020c
  1780. #define MUX_SEL_FSYS4 0x0210
  1781. #define MUX_ENABLE_FSYS0 0x0300
  1782. #define MUX_ENABLE_FSYS1 0x0304
  1783. #define MUX_ENABLE_FSYS2 0x0308
  1784. #define MUX_ENABLE_FSYS3 0x030c
  1785. #define MUX_ENABLE_FSYS4 0x0310
  1786. #define MUX_STAT_FSYS0 0x0400
  1787. #define MUX_STAT_FSYS1 0x0404
  1788. #define MUX_STAT_FSYS2 0x0408
  1789. #define MUX_STAT_FSYS3 0x040c
  1790. #define MUX_STAT_FSYS4 0x0410
  1791. #define MUX_IGNORE_FSYS2 0x0508
  1792. #define MUX_IGNORE_FSYS3 0x050c
  1793. #define ENABLE_ACLK_FSYS0 0x0800
  1794. #define ENABLE_ACLK_FSYS1 0x0804
  1795. #define ENABLE_PCLK_FSYS 0x0900
  1796. #define ENABLE_SCLK_FSYS 0x0a00
  1797. #define ENABLE_IP_FSYS0 0x0b00
  1798. #define ENABLE_IP_FSYS1 0x0b04
  1799. /* list of all parent clock list */
  1800. PNAME(mout_sclk_ufs_mphy_user_p) = { "oscclk", "sclk_ufs_mphy", };
  1801. PNAME(mout_aclk_fsys_200_user_p) = { "oscclk", "aclk_fsys_200", };
  1802. PNAME(mout_sclk_pcie_100_user_p) = { "oscclk", "sclk_pcie_100_fsys",};
  1803. PNAME(mout_sclk_ufsunipro_user_p) = { "oscclk", "sclk_ufsunipro_fsys",};
  1804. PNAME(mout_sclk_mmc2_user_p) = { "oscclk", "sclk_mmc2_fsys", };
  1805. PNAME(mout_sclk_mmc1_user_p) = { "oscclk", "sclk_mmc1_fsys", };
  1806. PNAME(mout_sclk_mmc0_user_p) = { "oscclk", "sclk_mmc0_fsys", };
  1807. PNAME(mout_sclk_usbhost30_user_p) = { "oscclk", "sclk_usbhost30_fsys",};
  1808. PNAME(mout_sclk_usbdrd30_user_p) = { "oscclk", "sclk_usbdrd30_fsys", };
  1809. PNAME(mout_phyclk_usbhost30_uhost30_pipe_pclk_user_p)
  1810. = { "oscclk", "phyclk_usbhost30_uhost30_pipe_pclk_phy", };
  1811. PNAME(mout_phyclk_usbhost30_uhost30_phyclock_user_p)
  1812. = { "oscclk", "phyclk_usbhost30_uhost30_phyclock_phy", };
  1813. PNAME(mout_phyclk_usbhost20_phy_hsic1_p)
  1814. = { "oscclk", "phyclk_usbhost20_phy_hsic1_phy", };
  1815. PNAME(mout_phyclk_usbhost20_phy_clk48mohci_user_p)
  1816. = { "oscclk", "phyclk_usbhost20_phy_clk48mohci_phy", };
  1817. PNAME(mout_phyclk_usbhost20_phy_phyclock_user_p)
  1818. = { "oscclk", "phyclk_usbhost20_phy_phyclock_phy", };
  1819. PNAME(mout_phyclk_usbhost20_phy_freeclk_user_p)
  1820. = { "oscclk", "phyclk_usbhost20_phy_freeclk_phy", };
  1821. PNAME(mout_phyclk_usbdrd30_udrd30_pipe_pclk_p)
  1822. = { "oscclk", "phyclk_usbdrd30_udrd30_pipe_pclk_phy", };
  1823. PNAME(mout_phyclk_usbdrd30_udrd30_phyclock_user_p)
  1824. = { "oscclk", "phyclk_usbdrd30_udrd30_phyclock_phy", };
  1825. PNAME(mout_phyclk_ufs_rx1_symbol_user_p)
  1826. = { "oscclk", "phyclk_ufs_rx1_symbol_phy", };
  1827. PNAME(mout_phyclk_ufs_rx0_symbol_user_p)
  1828. = { "oscclk", "phyclk_ufs_rx0_symbol_phy", };
  1829. PNAME(mout_phyclk_ufs_tx1_symbol_user_p)
  1830. = { "oscclk", "phyclk_ufs_tx1_symbol_phy", };
  1831. PNAME(mout_phyclk_ufs_tx0_symbol_user_p)
  1832. = { "oscclk", "phyclk_ufs_tx0_symbol_phy", };
  1833. PNAME(mout_phyclk_lli_mphy_to_ufs_user_p)
  1834. = { "oscclk", "phyclk_lli_mphy_to_ufs_phy", };
  1835. PNAME(mout_sclk_mphy_p)
  1836. = { "mout_sclk_ufs_mphy_user",
  1837. "mout_phyclk_lli_mphy_to_ufs_user", };
  1838. static const unsigned long fsys_clk_regs[] __initconst = {
  1839. MUX_SEL_FSYS0,
  1840. MUX_SEL_FSYS1,
  1841. MUX_SEL_FSYS2,
  1842. MUX_SEL_FSYS3,
  1843. MUX_SEL_FSYS4,
  1844. MUX_ENABLE_FSYS0,
  1845. MUX_ENABLE_FSYS1,
  1846. MUX_ENABLE_FSYS2,
  1847. MUX_ENABLE_FSYS3,
  1848. MUX_ENABLE_FSYS4,
  1849. MUX_IGNORE_FSYS2,
  1850. MUX_IGNORE_FSYS3,
  1851. ENABLE_ACLK_FSYS0,
  1852. ENABLE_ACLK_FSYS1,
  1853. ENABLE_PCLK_FSYS,
  1854. ENABLE_SCLK_FSYS,
  1855. ENABLE_IP_FSYS0,
  1856. ENABLE_IP_FSYS1,
  1857. };
  1858. static const struct samsung_fixed_rate_clock fsys_fixed_clks[] __initconst = {
  1859. /* PHY clocks from USBDRD30_PHY */
  1860. FRATE(CLK_PHYCLK_USBDRD30_UDRD30_PHYCLOCK_PHY,
  1861. "phyclk_usbdrd30_udrd30_phyclock_phy", NULL,
  1862. 0, 60000000),
  1863. FRATE(CLK_PHYCLK_USBDRD30_UDRD30_PIPE_PCLK_PHY,
  1864. "phyclk_usbdrd30_udrd30_pipe_pclk_phy", NULL,
  1865. 0, 125000000),
  1866. /* PHY clocks from USBHOST30_PHY */
  1867. FRATE(CLK_PHYCLK_USBHOST30_UHOST30_PHYCLOCK_PHY,
  1868. "phyclk_usbhost30_uhost30_phyclock_phy", NULL,
  1869. 0, 60000000),
  1870. FRATE(CLK_PHYCLK_USBHOST30_UHOST30_PIPE_PCLK_PHY,
  1871. "phyclk_usbhost30_uhost30_pipe_pclk_phy", NULL,
  1872. 0, 125000000),
  1873. /* PHY clocks from USBHOST20_PHY */
  1874. FRATE(CLK_PHYCLK_USBHOST20_PHY_FREECLK_PHY,
  1875. "phyclk_usbhost20_phy_freeclk_phy", NULL, 0, 60000000),
  1876. FRATE(CLK_PHYCLK_USBHOST20_PHY_PHYCLOCK_PHY,
  1877. "phyclk_usbhost20_phy_phyclock_phy", NULL, 0, 60000000),
  1878. FRATE(CLK_PHYCLK_USBHOST20_PHY_CLK48MOHCI_PHY,
  1879. "phyclk_usbhost20_phy_clk48mohci_phy", NULL,
  1880. 0, 48000000),
  1881. FRATE(CLK_PHYCLK_USBHOST20_PHY_HSIC1_PHY,
  1882. "phyclk_usbhost20_phy_hsic1_phy", NULL, 0,
  1883. 60000000),
  1884. /* PHY clocks from UFS_PHY */
  1885. FRATE(CLK_PHYCLK_UFS_TX0_SYMBOL_PHY, "phyclk_ufs_tx0_symbol_phy",
  1886. NULL, 0, 300000000),
  1887. FRATE(CLK_PHYCLK_UFS_RX0_SYMBOL_PHY, "phyclk_ufs_rx0_symbol_phy",
  1888. NULL, 0, 300000000),
  1889. FRATE(CLK_PHYCLK_UFS_TX1_SYMBOL_PHY, "phyclk_ufs_tx1_symbol_phy",
  1890. NULL, 0, 300000000),
  1891. FRATE(CLK_PHYCLK_UFS_RX1_SYMBOL_PHY, "phyclk_ufs_rx1_symbol_phy",
  1892. NULL, 0, 300000000),
  1893. /* PHY clocks from LLI_PHY */
  1894. FRATE(CLK_PHYCLK_LLI_MPHY_TO_UFS_PHY, "phyclk_lli_mphy_to_ufs_phy",
  1895. NULL, 0, 26000000),
  1896. };
  1897. static const struct samsung_mux_clock fsys_mux_clks[] __initconst = {
  1898. /* MUX_SEL_FSYS0 */
  1899. MUX(CLK_MOUT_SCLK_UFS_MPHY_USER, "mout_sclk_ufs_mphy_user",
  1900. mout_sclk_ufs_mphy_user_p, MUX_SEL_FSYS0, 4, 1),
  1901. MUX(CLK_MOUT_ACLK_FSYS_200_USER, "mout_aclk_fsys_200_user",
  1902. mout_aclk_fsys_200_user_p, MUX_SEL_FSYS0, 0, 1),
  1903. /* MUX_SEL_FSYS1 */
  1904. MUX(CLK_MOUT_SCLK_PCIE_100_USER, "mout_sclk_pcie_100_user",
  1905. mout_sclk_pcie_100_user_p, MUX_SEL_FSYS1, 28, 1),
  1906. MUX(CLK_MOUT_SCLK_UFSUNIPRO_USER, "mout_sclk_ufsunipro_user",
  1907. mout_sclk_ufsunipro_user_p, MUX_SEL_FSYS1, 24, 1),
  1908. MUX(CLK_MOUT_SCLK_MMC2_USER, "mout_sclk_mmc2_user",
  1909. mout_sclk_mmc2_user_p, MUX_SEL_FSYS1, 20, 1),
  1910. MUX(CLK_MOUT_SCLK_MMC1_USER, "mout_sclk_mmc1_user",
  1911. mout_sclk_mmc1_user_p, MUX_SEL_FSYS1, 16, 1),
  1912. MUX(CLK_MOUT_SCLK_MMC0_USER, "mout_sclk_mmc0_user",
  1913. mout_sclk_mmc0_user_p, MUX_SEL_FSYS1, 12, 1),
  1914. MUX(CLK_MOUT_SCLK_USBHOST30_USER, "mout_sclk_usbhost30_user",
  1915. mout_sclk_usbhost30_user_p, MUX_SEL_FSYS1, 4, 1),
  1916. MUX(CLK_MOUT_SCLK_USBDRD30_USER, "mout_sclk_usbdrd30_user",
  1917. mout_sclk_usbdrd30_user_p, MUX_SEL_FSYS1, 0, 1),
  1918. /* MUX_SEL_FSYS2 */
  1919. MUX(CLK_MOUT_PHYCLK_USBHOST30_UHOST30_PIPE_PCLK_USER,
  1920. "mout_phyclk_usbhost30_uhost30_pipe_pclk_user",
  1921. mout_phyclk_usbhost30_uhost30_pipe_pclk_user_p,
  1922. MUX_SEL_FSYS2, 28, 1),
  1923. MUX(CLK_MOUT_PHYCLK_USBHOST30_UHOST30_PHYCLOCK_USER,
  1924. "mout_phyclk_usbhost30_uhost30_phyclock_user",
  1925. mout_phyclk_usbhost30_uhost30_phyclock_user_p,
  1926. MUX_SEL_FSYS2, 24, 1),
  1927. MUX(CLK_MOUT_PHYCLK_USBHOST20_PHY_HSIC1_USER,
  1928. "mout_phyclk_usbhost20_phy_hsic1",
  1929. mout_phyclk_usbhost20_phy_hsic1_p,
  1930. MUX_SEL_FSYS2, 20, 1),
  1931. MUX(CLK_MOUT_PHYCLK_USBHOST20_PHY_CLK48MOHCI_USER,
  1932. "mout_phyclk_usbhost20_phy_clk48mohci_user",
  1933. mout_phyclk_usbhost20_phy_clk48mohci_user_p,
  1934. MUX_SEL_FSYS2, 16, 1),
  1935. MUX(CLK_MOUT_PHYCLK_USBHOST20_PHY_PHYCLOCK_USER,
  1936. "mout_phyclk_usbhost20_phy_phyclock_user",
  1937. mout_phyclk_usbhost20_phy_phyclock_user_p,
  1938. MUX_SEL_FSYS2, 12, 1),
  1939. MUX(CLK_MOUT_PHYCLK_USBHOST20_PHY_PHY_FREECLK_USER,
  1940. "mout_phyclk_usbhost20_phy_freeclk_user",
  1941. mout_phyclk_usbhost20_phy_freeclk_user_p,
  1942. MUX_SEL_FSYS2, 8, 1),
  1943. MUX(CLK_MOUT_PHYCLK_USBDRD30_UDRD30_PIPE_PCLK_USER,
  1944. "mout_phyclk_usbdrd30_udrd30_pipe_pclk_user",
  1945. mout_phyclk_usbdrd30_udrd30_pipe_pclk_p,
  1946. MUX_SEL_FSYS2, 4, 1),
  1947. MUX(CLK_MOUT_PHYCLK_USBDRD30_UDRD30_PHYCLOCK_USER,
  1948. "mout_phyclk_usbdrd30_udrd30_phyclock_user",
  1949. mout_phyclk_usbdrd30_udrd30_phyclock_user_p,
  1950. MUX_SEL_FSYS2, 0, 1),
  1951. /* MUX_SEL_FSYS3 */
  1952. MUX(CLK_MOUT_PHYCLK_UFS_RX1_SYMBOL_USER,
  1953. "mout_phyclk_ufs_rx1_symbol_user",
  1954. mout_phyclk_ufs_rx1_symbol_user_p,
  1955. MUX_SEL_FSYS3, 16, 1),
  1956. MUX(CLK_MOUT_PHYCLK_UFS_RX0_SYMBOL_USER,
  1957. "mout_phyclk_ufs_rx0_symbol_user",
  1958. mout_phyclk_ufs_rx0_symbol_user_p,
  1959. MUX_SEL_FSYS3, 12, 1),
  1960. MUX(CLK_MOUT_PHYCLK_UFS_TX1_SYMBOL_USER,
  1961. "mout_phyclk_ufs_tx1_symbol_user",
  1962. mout_phyclk_ufs_tx1_symbol_user_p,
  1963. MUX_SEL_FSYS3, 8, 1),
  1964. MUX(CLK_MOUT_PHYCLK_UFS_TX0_SYMBOL_USER,
  1965. "mout_phyclk_ufs_tx0_symbol_user",
  1966. mout_phyclk_ufs_tx0_symbol_user_p,
  1967. MUX_SEL_FSYS3, 4, 1),
  1968. MUX(CLK_MOUT_PHYCLK_LLI_MPHY_TO_UFS_USER,
  1969. "mout_phyclk_lli_mphy_to_ufs_user",
  1970. mout_phyclk_lli_mphy_to_ufs_user_p,
  1971. MUX_SEL_FSYS3, 0, 1),
  1972. /* MUX_SEL_FSYS4 */
  1973. MUX(CLK_MOUT_SCLK_MPHY, "mout_sclk_mphy", mout_sclk_mphy_p,
  1974. MUX_SEL_FSYS4, 0, 1),
  1975. };
  1976. static const struct samsung_gate_clock fsys_gate_clks[] __initconst = {
  1977. /* ENABLE_ACLK_FSYS0 */
  1978. GATE(CLK_ACLK_PCIE, "aclk_pcie", "mout_aclk_fsys_200_user",
  1979. ENABLE_ACLK_FSYS0, 13, CLK_IGNORE_UNUSED, 0),
  1980. GATE(CLK_ACLK_PDMA1, "aclk_pdma1", "mout_aclk_fsys_200_user",
  1981. ENABLE_ACLK_FSYS0, 11, CLK_IGNORE_UNUSED, 0),
  1982. GATE(CLK_ACLK_TSI, "aclk_tsi", "mout_aclk_fsys_200_user",
  1983. ENABLE_ACLK_FSYS0, 10, CLK_IGNORE_UNUSED, 0),
  1984. GATE(CLK_ACLK_MMC2, "aclk_mmc2", "mout_aclk_fsys_200_user",
  1985. ENABLE_ACLK_FSYS0, 8, CLK_IGNORE_UNUSED, 0),
  1986. GATE(CLK_ACLK_MMC1, "aclk_mmc1", "mout_aclk_fsys_200_user",
  1987. ENABLE_ACLK_FSYS0, 7, CLK_IGNORE_UNUSED, 0),
  1988. GATE(CLK_ACLK_MMC0, "aclk_mmc0", "mout_aclk_fsys_200_user",
  1989. ENABLE_ACLK_FSYS0, 6, CLK_IGNORE_UNUSED, 0),
  1990. GATE(CLK_ACLK_UFS, "aclk_ufs", "mout_aclk_fsys_200_user",
  1991. ENABLE_ACLK_FSYS0, 5, CLK_IGNORE_UNUSED, 0),
  1992. GATE(CLK_ACLK_USBHOST20, "aclk_usbhost20", "mout_aclk_fsys_200_user",
  1993. ENABLE_ACLK_FSYS0, 3, CLK_IGNORE_UNUSED, 0),
  1994. GATE(CLK_ACLK_USBHOST30, "aclk_usbhost30", "mout_aclk_fsys_200_user",
  1995. ENABLE_ACLK_FSYS0, 2, CLK_IGNORE_UNUSED, 0),
  1996. GATE(CLK_ACLK_USBDRD30, "aclk_usbdrd30", "mout_aclk_fsys_200_user",
  1997. ENABLE_ACLK_FSYS0, 1, CLK_IGNORE_UNUSED, 0),
  1998. GATE(CLK_ACLK_PDMA0, "aclk_pdma0", "mout_aclk_fsys_200_user",
  1999. ENABLE_ACLK_FSYS0, 0, CLK_IGNORE_UNUSED, 0),
  2000. /* ENABLE_ACLK_FSYS1 */
  2001. GATE(CLK_ACLK_XIU_FSYSPX, "aclk_xiu_fsyspx", "mout_aclk_fsys_200_user",
  2002. ENABLE_ACLK_FSYS1, 27, CLK_IGNORE_UNUSED, 0),
  2003. GATE(CLK_ACLK_AHB_USBLINKH1, "aclk_ahb_usblinkh1",
  2004. "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
  2005. 26, CLK_IGNORE_UNUSED, 0),
  2006. GATE(CLK_ACLK_SMMU_PDMA1, "aclk_smmu_pdma1", "mout_aclk_fsys_200_user",
  2007. ENABLE_ACLK_FSYS1, 25, CLK_IGNORE_UNUSED, 0),
  2008. GATE(CLK_ACLK_BTS_PCIE, "aclk_bts_pcie", "mout_aclk_fsys_200_user",
  2009. ENABLE_ACLK_FSYS1, 24, CLK_IGNORE_UNUSED, 0),
  2010. GATE(CLK_ACLK_AXIUS_PDMA1, "aclk_axius_pdma1",
  2011. "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
  2012. 22, CLK_IGNORE_UNUSED, 0),
  2013. GATE(CLK_ACLK_SMMU_PDMA0, "aclk_smmu_pdma0", "mout_aclk_fsys_200_user",
  2014. ENABLE_ACLK_FSYS1, 17, CLK_IGNORE_UNUSED, 0),
  2015. GATE(CLK_ACLK_BTS_UFS, "aclk_bts_ufs", "mout_aclk_fsys_200_user",
  2016. ENABLE_ACLK_FSYS1, 14, CLK_IGNORE_UNUSED, 0),
  2017. GATE(CLK_ACLK_BTS_USBHOST30, "aclk_bts_usbhost30",
  2018. "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
  2019. 13, 0, 0),
  2020. GATE(CLK_ACLK_BTS_USBDRD30, "aclk_bts_usbdrd30",
  2021. "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
  2022. 12, 0, 0),
  2023. GATE(CLK_ACLK_AXIUS_PDMA0, "aclk_axius_pdma0",
  2024. "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
  2025. 11, CLK_IGNORE_UNUSED, 0),
  2026. GATE(CLK_ACLK_AXIUS_USBHS, "aclk_axius_usbhs",
  2027. "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
  2028. 10, CLK_IGNORE_UNUSED, 0),
  2029. GATE(CLK_ACLK_AXIUS_FSYSSX, "aclk_axius_fsyssx",
  2030. "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
  2031. 9, CLK_IGNORE_UNUSED, 0),
  2032. GATE(CLK_ACLK_AHB2APB_FSYSP, "aclk_ahb2apb_fsysp",
  2033. "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
  2034. 8, CLK_IGNORE_UNUSED, 0),
  2035. GATE(CLK_ACLK_AHB2AXI_USBHS, "aclk_ahb2axi_usbhs",
  2036. "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
  2037. 7, CLK_IGNORE_UNUSED, 0),
  2038. GATE(CLK_ACLK_AHB_USBLINKH0, "aclk_ahb_usblinkh0",
  2039. "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
  2040. 6, CLK_IGNORE_UNUSED, 0),
  2041. GATE(CLK_ACLK_AHB_USBHS, "aclk_ahb_usbhs", "mout_aclk_fsys_200_user",
  2042. ENABLE_ACLK_FSYS1, 5, CLK_IGNORE_UNUSED, 0),
  2043. GATE(CLK_ACLK_AHB_FSYSH, "aclk_ahb_fsysh", "mout_aclk_fsys_200_user",
  2044. ENABLE_ACLK_FSYS1, 4, CLK_IGNORE_UNUSED, 0),
  2045. GATE(CLK_ACLK_XIU_FSYSX, "aclk_xiu_fsysx", "mout_aclk_fsys_200_user",
  2046. ENABLE_ACLK_FSYS1, 3, CLK_IGNORE_UNUSED, 0),
  2047. GATE(CLK_ACLK_XIU_FSYSSX, "aclk_xiu_fsyssx", "mout_aclk_fsys_200_user",
  2048. ENABLE_ACLK_FSYS1, 2, CLK_IGNORE_UNUSED, 0),
  2049. GATE(CLK_ACLK_FSYSNP_200, "aclk_fsysnp_200", "mout_aclk_fsys_200_user",
  2050. ENABLE_ACLK_FSYS1, 1, CLK_IGNORE_UNUSED, 0),
  2051. GATE(CLK_ACLK_FSYSND_200, "aclk_fsysnd_200", "mout_aclk_fsys_200_user",
  2052. ENABLE_ACLK_FSYS1, 0, CLK_IGNORE_UNUSED, 0),
  2053. /* ENABLE_PCLK_FSYS */
  2054. GATE(CLK_PCLK_PCIE_CTRL, "pclk_pcie_ctrl", "mout_aclk_fsys_200_user",
  2055. ENABLE_PCLK_FSYS, 17, CLK_IGNORE_UNUSED, 0),
  2056. GATE(CLK_PCLK_SMMU_PDMA1, "pclk_smmu_pdma1", "mout_aclk_fsys_200_user",
  2057. ENABLE_PCLK_FSYS, 16, CLK_IGNORE_UNUSED, 0),
  2058. GATE(CLK_PCLK_PCIE_PHY, "pclk_pcie_phy", "mout_aclk_fsys_200_user",
  2059. ENABLE_PCLK_FSYS, 14, CLK_IGNORE_UNUSED, 0),
  2060. GATE(CLK_PCLK_BTS_PCIE, "pclk_bts_pcie", "mout_aclk_fsys_200_user",
  2061. ENABLE_PCLK_FSYS, 13, CLK_IGNORE_UNUSED, 0),
  2062. GATE(CLK_PCLK_SMMU_PDMA0, "pclk_smmu_pdma0", "mout_aclk_fsys_200_user",
  2063. ENABLE_PCLK_FSYS, 8, CLK_IGNORE_UNUSED, 0),
  2064. GATE(CLK_PCLK_BTS_UFS, "pclk_bts_ufs", "mout_aclk_fsys_200_user",
  2065. ENABLE_PCLK_FSYS, 5, 0, 0),
  2066. GATE(CLK_PCLK_BTS_USBHOST30, "pclk_bts_usbhost30",
  2067. "mout_aclk_fsys_200_user", ENABLE_PCLK_FSYS, 4, 0, 0),
  2068. GATE(CLK_PCLK_BTS_USBDRD30, "pclk_bts_usbdrd30",
  2069. "mout_aclk_fsys_200_user", ENABLE_PCLK_FSYS, 3, 0, 0),
  2070. GATE(CLK_PCLK_GPIO_FSYS, "pclk_gpio_fsys", "mout_aclk_fsys_200_user",
  2071. ENABLE_PCLK_FSYS, 2, CLK_IGNORE_UNUSED, 0),
  2072. GATE(CLK_PCLK_PMU_FSYS, "pclk_pmu_fsys", "mout_aclk_fsys_200_user",
  2073. ENABLE_PCLK_FSYS, 1, CLK_IGNORE_UNUSED, 0),
  2074. GATE(CLK_PCLK_SYSREG_FSYS, "pclk_sysreg_fsys",
  2075. "mout_aclk_fsys_200_user", ENABLE_PCLK_FSYS,
  2076. 0, CLK_IGNORE_UNUSED, 0),
  2077. /* ENABLE_SCLK_FSYS */
  2078. GATE(CLK_SCLK_PCIE_100, "sclk_pcie_100", "mout_sclk_pcie_100_user",
  2079. ENABLE_SCLK_FSYS, 21, 0, 0),
  2080. GATE(CLK_PHYCLK_USBHOST30_UHOST30_PIPE_PCLK,
  2081. "phyclk_usbhost30_uhost30_pipe_pclk",
  2082. "mout_phyclk_usbhost30_uhost30_pipe_pclk_user",
  2083. ENABLE_SCLK_FSYS, 18, 0, 0),
  2084. GATE(CLK_PHYCLK_USBHOST30_UHOST30_PHYCLOCK,
  2085. "phyclk_usbhost30_uhost30_phyclock",
  2086. "mout_phyclk_usbhost30_uhost30_phyclock_user",
  2087. ENABLE_SCLK_FSYS, 17, 0, 0),
  2088. GATE(CLK_PHYCLK_UFS_RX1_SYMBOL, "phyclk_ufs_rx1_symbol",
  2089. "mout_phyclk_ufs_rx1_symbol_user", ENABLE_SCLK_FSYS,
  2090. 16, 0, 0),
  2091. GATE(CLK_PHYCLK_UFS_RX0_SYMBOL, "phyclk_ufs_rx0_symbol",
  2092. "mout_phyclk_ufs_rx0_symbol_user", ENABLE_SCLK_FSYS,
  2093. 15, 0, 0),
  2094. GATE(CLK_PHYCLK_UFS_TX1_SYMBOL, "phyclk_ufs_tx1_symbol",
  2095. "mout_phyclk_ufs_tx1_symbol_user", ENABLE_SCLK_FSYS,
  2096. 14, 0, 0),
  2097. GATE(CLK_PHYCLK_UFS_TX0_SYMBOL, "phyclk_ufs_tx0_symbol",
  2098. "mout_phyclk_ufs_tx0_symbol_user", ENABLE_SCLK_FSYS,
  2099. 13, 0, 0),
  2100. GATE(CLK_PHYCLK_USBHOST20_PHY_HSIC1, "phyclk_usbhost20_phy_hsic1",
  2101. "mout_phyclk_usbhost20_phy_hsic1", ENABLE_SCLK_FSYS,
  2102. 12, 0, 0),
  2103. GATE(CLK_PHYCLK_USBHOST20_PHY_CLK48MOHCI,
  2104. "phyclk_usbhost20_phy_clk48mohci",
  2105. "mout_phyclk_usbhost20_phy_clk48mohci_user",
  2106. ENABLE_SCLK_FSYS, 11, 0, 0),
  2107. GATE(CLK_PHYCLK_USBHOST20_PHY_PHYCLOCK,
  2108. "phyclk_usbhost20_phy_phyclock",
  2109. "mout_phyclk_usbhost20_phy_phyclock_user",
  2110. ENABLE_SCLK_FSYS, 10, 0, 0),
  2111. GATE(CLK_PHYCLK_USBHOST20_PHY_FREECLK,
  2112. "phyclk_usbhost20_phy_freeclk",
  2113. "mout_phyclk_usbhost20_phy_freeclk_user",
  2114. ENABLE_SCLK_FSYS, 9, 0, 0),
  2115. GATE(CLK_PHYCLK_USBDRD30_UDRD30_PIPE_PCLK,
  2116. "phyclk_usbdrd30_udrd30_pipe_pclk",
  2117. "mout_phyclk_usbdrd30_udrd30_pipe_pclk_user",
  2118. ENABLE_SCLK_FSYS, 8, 0, 0),
  2119. GATE(CLK_PHYCLK_USBDRD30_UDRD30_PHYCLOCK,
  2120. "phyclk_usbdrd30_udrd30_phyclock",
  2121. "mout_phyclk_usbdrd30_udrd30_phyclock_user",
  2122. ENABLE_SCLK_FSYS, 7, 0, 0),
  2123. GATE(CLK_SCLK_MPHY, "sclk_mphy", "mout_sclk_mphy",
  2124. ENABLE_SCLK_FSYS, 6, 0, 0),
  2125. GATE(CLK_SCLK_UFSUNIPRO, "sclk_ufsunipro", "mout_sclk_ufsunipro_user",
  2126. ENABLE_SCLK_FSYS, 5, 0, 0),
  2127. GATE(CLK_SCLK_MMC2, "sclk_mmc2", "mout_sclk_mmc2_user",
  2128. ENABLE_SCLK_FSYS, 4, CLK_SET_RATE_PARENT, 0),
  2129. GATE(CLK_SCLK_MMC1, "sclk_mmc1", "mout_sclk_mmc1_user",
  2130. ENABLE_SCLK_FSYS, 3, CLK_SET_RATE_PARENT, 0),
  2131. GATE(CLK_SCLK_MMC0, "sclk_mmc0", "mout_sclk_mmc0_user",
  2132. ENABLE_SCLK_FSYS, 2, CLK_SET_RATE_PARENT, 0),
  2133. GATE(CLK_SCLK_USBHOST30, "sclk_usbhost30", "mout_sclk_usbhost30_user",
  2134. ENABLE_SCLK_FSYS, 1, 0, 0),
  2135. GATE(CLK_SCLK_USBDRD30, "sclk_usbdrd30", "mout_sclk_usbdrd30_user",
  2136. ENABLE_SCLK_FSYS, 0, 0, 0),
  2137. /* ENABLE_IP_FSYS0 */
  2138. GATE(CLK_PCIE, "pcie", "sclk_pcie_100", ENABLE_IP_FSYS0, 17, 0, 0),
  2139. GATE(CLK_PDMA1, "pdma1", "aclk_pdma1", ENABLE_IP_FSYS0, 15, 0, 0),
  2140. GATE(CLK_PDMA0, "pdma0", "aclk_pdma0", ENABLE_IP_FSYS0, 0, 0, 0),
  2141. };
  2142. static const struct samsung_cmu_info fsys_cmu_info __initconst = {
  2143. .mux_clks = fsys_mux_clks,
  2144. .nr_mux_clks = ARRAY_SIZE(fsys_mux_clks),
  2145. .gate_clks = fsys_gate_clks,
  2146. .nr_gate_clks = ARRAY_SIZE(fsys_gate_clks),
  2147. .fixed_clks = fsys_fixed_clks,
  2148. .nr_fixed_clks = ARRAY_SIZE(fsys_fixed_clks),
  2149. .nr_clk_ids = FSYS_NR_CLK,
  2150. .clk_regs = fsys_clk_regs,
  2151. .nr_clk_regs = ARRAY_SIZE(fsys_clk_regs),
  2152. };
  2153. static void __init exynos5433_cmu_fsys_init(struct device_node *np)
  2154. {
  2155. samsung_cmu_register_one(np, &fsys_cmu_info);
  2156. }
  2157. CLK_OF_DECLARE(exynos5433_cmu_fsys, "samsung,exynos5433-cmu-fsys",
  2158. exynos5433_cmu_fsys_init);
  2159. /*
  2160. * Register offset definitions for CMU_G2D
  2161. */
  2162. #define MUX_SEL_G2D0 0x0200
  2163. #define MUX_SEL_ENABLE_G2D0 0x0300
  2164. #define MUX_SEL_STAT_G2D0 0x0400
  2165. #define DIV_G2D 0x0600
  2166. #define DIV_STAT_G2D 0x0700
  2167. #define DIV_ENABLE_ACLK_G2D 0x0800
  2168. #define DIV_ENABLE_ACLK_G2D_SECURE_SMMU_G2D 0x0804
  2169. #define DIV_ENABLE_PCLK_G2D 0x0900
  2170. #define DIV_ENABLE_PCLK_G2D_SECURE_SMMU_G2D 0x0904
  2171. #define DIV_ENABLE_IP_G2D0 0x0b00
  2172. #define DIV_ENABLE_IP_G2D1 0x0b04
  2173. #define DIV_ENABLE_IP_G2D_SECURE_SMMU_G2D 0x0b08
  2174. static const unsigned long g2d_clk_regs[] __initconst = {
  2175. MUX_SEL_G2D0,
  2176. MUX_SEL_ENABLE_G2D0,
  2177. DIV_G2D,
  2178. DIV_ENABLE_ACLK_G2D,
  2179. DIV_ENABLE_ACLK_G2D_SECURE_SMMU_G2D,
  2180. DIV_ENABLE_PCLK_G2D,
  2181. DIV_ENABLE_PCLK_G2D_SECURE_SMMU_G2D,
  2182. DIV_ENABLE_IP_G2D0,
  2183. DIV_ENABLE_IP_G2D1,
  2184. DIV_ENABLE_IP_G2D_SECURE_SMMU_G2D,
  2185. };
  2186. /* list of all parent clock list */
  2187. PNAME(mout_aclk_g2d_266_user_p) = { "oscclk", "aclk_g2d_266", };
  2188. PNAME(mout_aclk_g2d_400_user_p) = { "oscclk", "aclk_g2d_400", };
  2189. static const struct samsung_mux_clock g2d_mux_clks[] __initconst = {
  2190. /* MUX_SEL_G2D0 */
  2191. MUX(CLK_MUX_ACLK_G2D_266_USER, "mout_aclk_g2d_266_user",
  2192. mout_aclk_g2d_266_user_p, MUX_SEL_G2D0, 4, 1),
  2193. MUX(CLK_MUX_ACLK_G2D_400_USER, "mout_aclk_g2d_400_user",
  2194. mout_aclk_g2d_400_user_p, MUX_SEL_G2D0, 0, 1),
  2195. };
  2196. static const struct samsung_div_clock g2d_div_clks[] __initconst = {
  2197. /* DIV_G2D */
  2198. DIV(CLK_DIV_PCLK_G2D, "div_pclk_g2d", "mout_aclk_g2d_266_user",
  2199. DIV_G2D, 0, 2),
  2200. };
  2201. static const struct samsung_gate_clock g2d_gate_clks[] __initconst = {
  2202. /* DIV_ENABLE_ACLK_G2D */
  2203. GATE(CLK_ACLK_SMMU_MDMA1, "aclk_smmu_mdma1", "mout_aclk_g2d_266_user",
  2204. DIV_ENABLE_ACLK_G2D, 12, 0, 0),
  2205. GATE(CLK_ACLK_BTS_MDMA1, "aclk_bts_mdam1", "mout_aclk_g2d_266_user",
  2206. DIV_ENABLE_ACLK_G2D, 11, 0, 0),
  2207. GATE(CLK_ACLK_BTS_G2D, "aclk_bts_g2d", "mout_aclk_g2d_400_user",
  2208. DIV_ENABLE_ACLK_G2D, 10, 0, 0),
  2209. GATE(CLK_ACLK_ALB_G2D, "aclk_alb_g2d", "mout_aclk_g2d_400_user",
  2210. DIV_ENABLE_ACLK_G2D, 9, 0, 0),
  2211. GATE(CLK_ACLK_AXIUS_G2DX, "aclk_axius_g2dx", "mout_aclk_g2d_400_user",
  2212. DIV_ENABLE_ACLK_G2D, 8, 0, 0),
  2213. GATE(CLK_ACLK_ASYNCAXI_SYSX, "aclk_asyncaxi_sysx",
  2214. "mout_aclk_g2d_400_user", DIV_ENABLE_ACLK_G2D,
  2215. 7, 0, 0),
  2216. GATE(CLK_ACLK_AHB2APB_G2D1P, "aclk_ahb2apb_g2d1p", "div_pclk_g2d",
  2217. DIV_ENABLE_ACLK_G2D, 6, CLK_IGNORE_UNUSED, 0),
  2218. GATE(CLK_ACLK_AHB2APB_G2D0P, "aclk_ahb2apb_g2d0p", "div_pclk_g2d",
  2219. DIV_ENABLE_ACLK_G2D, 5, CLK_IGNORE_UNUSED, 0),
  2220. GATE(CLK_ACLK_XIU_G2DX, "aclk_xiu_g2dx", "mout_aclk_g2d_400_user",
  2221. DIV_ENABLE_ACLK_G2D, 4, CLK_IGNORE_UNUSED, 0),
  2222. GATE(CLK_ACLK_G2DNP_133, "aclk_g2dnp_133", "div_pclk_g2d",
  2223. DIV_ENABLE_ACLK_G2D, 3, CLK_IGNORE_UNUSED, 0),
  2224. GATE(CLK_ACLK_G2DND_400, "aclk_g2dnd_400", "mout_aclk_g2d_400_user",
  2225. DIV_ENABLE_ACLK_G2D, 2, CLK_IGNORE_UNUSED, 0),
  2226. GATE(CLK_ACLK_MDMA1, "aclk_mdma1", "mout_aclk_g2d_266_user",
  2227. DIV_ENABLE_ACLK_G2D, 1, 0, 0),
  2228. GATE(CLK_ACLK_G2D, "aclk_g2d", "mout_aclk_g2d_400_user",
  2229. DIV_ENABLE_ACLK_G2D, 0, 0, 0),
  2230. /* DIV_ENABLE_ACLK_G2D_SECURE_SMMU_G2D */
  2231. GATE(CLK_ACLK_SMMU_G2D, "aclk_smmu_g2d", "mout_aclk_g2d_400_user",
  2232. DIV_ENABLE_ACLK_G2D_SECURE_SMMU_G2D, 0, 0, 0),
  2233. /* DIV_ENABLE_PCLK_G2D */
  2234. GATE(CLK_PCLK_SMMU_MDMA1, "pclk_smmu_mdma1", "div_pclk_g2d",
  2235. DIV_ENABLE_PCLK_G2D, 7, 0, 0),
  2236. GATE(CLK_PCLK_BTS_MDMA1, "pclk_bts_mdam1", "div_pclk_g2d",
  2237. DIV_ENABLE_PCLK_G2D, 6, 0, 0),
  2238. GATE(CLK_PCLK_BTS_G2D, "pclk_bts_g2d", "div_pclk_g2d",
  2239. DIV_ENABLE_PCLK_G2D, 5, 0, 0),
  2240. GATE(CLK_PCLK_ALB_G2D, "pclk_alb_g2d", "div_pclk_g2d",
  2241. DIV_ENABLE_PCLK_G2D, 4, 0, 0),
  2242. GATE(CLK_PCLK_ASYNCAXI_SYSX, "pclk_asyncaxi_sysx", "div_pclk_g2d",
  2243. DIV_ENABLE_PCLK_G2D, 3, 0, 0),
  2244. GATE(CLK_PCLK_PMU_G2D, "pclk_pmu_g2d", "div_pclk_g2d",
  2245. DIV_ENABLE_PCLK_G2D, 2, CLK_IGNORE_UNUSED, 0),
  2246. GATE(CLK_PCLK_SYSREG_G2D, "pclk_sysreg_g2d", "div_pclk_g2d",
  2247. DIV_ENABLE_PCLK_G2D, 1, CLK_IGNORE_UNUSED, 0),
  2248. GATE(CLK_PCLK_G2D, "pclk_g2d", "div_pclk_g2d", DIV_ENABLE_PCLK_G2D,
  2249. 0, 0, 0),
  2250. /* DIV_ENABLE_PCLK_G2D_SECURE_SMMU_G2D */
  2251. GATE(CLK_PCLK_SMMU_G2D, "pclk_smmu_g2d", "div_pclk_g2d",
  2252. DIV_ENABLE_PCLK_G2D_SECURE_SMMU_G2D, 0, 0, 0),
  2253. };
  2254. static const struct samsung_cmu_info g2d_cmu_info __initconst = {
  2255. .mux_clks = g2d_mux_clks,
  2256. .nr_mux_clks = ARRAY_SIZE(g2d_mux_clks),
  2257. .div_clks = g2d_div_clks,
  2258. .nr_div_clks = ARRAY_SIZE(g2d_div_clks),
  2259. .gate_clks = g2d_gate_clks,
  2260. .nr_gate_clks = ARRAY_SIZE(g2d_gate_clks),
  2261. .nr_clk_ids = G2D_NR_CLK,
  2262. .clk_regs = g2d_clk_regs,
  2263. .nr_clk_regs = ARRAY_SIZE(g2d_clk_regs),
  2264. };
  2265. static void __init exynos5433_cmu_g2d_init(struct device_node *np)
  2266. {
  2267. samsung_cmu_register_one(np, &g2d_cmu_info);
  2268. }
  2269. CLK_OF_DECLARE(exynos5433_cmu_g2d, "samsung,exynos5433-cmu-g2d",
  2270. exynos5433_cmu_g2d_init);
  2271. /*
  2272. * Register offset definitions for CMU_DISP
  2273. */
  2274. #define DISP_PLL_LOCK 0x0000
  2275. #define DISP_PLL_CON0 0x0100
  2276. #define DISP_PLL_CON1 0x0104
  2277. #define DISP_PLL_FREQ_DET 0x0108
  2278. #define MUX_SEL_DISP0 0x0200
  2279. #define MUX_SEL_DISP1 0x0204
  2280. #define MUX_SEL_DISP2 0x0208
  2281. #define MUX_SEL_DISP3 0x020c
  2282. #define MUX_SEL_DISP4 0x0210
  2283. #define MUX_ENABLE_DISP0 0x0300
  2284. #define MUX_ENABLE_DISP1 0x0304
  2285. #define MUX_ENABLE_DISP2 0x0308
  2286. #define MUX_ENABLE_DISP3 0x030c
  2287. #define MUX_ENABLE_DISP4 0x0310
  2288. #define MUX_STAT_DISP0 0x0400
  2289. #define MUX_STAT_DISP1 0x0404
  2290. #define MUX_STAT_DISP2 0x0408
  2291. #define MUX_STAT_DISP3 0x040c
  2292. #define MUX_STAT_DISP4 0x0410
  2293. #define MUX_IGNORE_DISP2 0x0508
  2294. #define DIV_DISP 0x0600
  2295. #define DIV_DISP_PLL_FREQ_DET 0x0604
  2296. #define DIV_STAT_DISP 0x0700
  2297. #define DIV_STAT_DISP_PLL_FREQ_DET 0x0704
  2298. #define ENABLE_ACLK_DISP0 0x0800
  2299. #define ENABLE_ACLK_DISP1 0x0804
  2300. #define ENABLE_PCLK_DISP 0x0900
  2301. #define ENABLE_SCLK_DISP 0x0a00
  2302. #define ENABLE_IP_DISP0 0x0b00
  2303. #define ENABLE_IP_DISP1 0x0b04
  2304. #define CLKOUT_CMU_DISP 0x0c00
  2305. #define CLKOUT_CMU_DISP_DIV_STAT 0x0c04
  2306. static const unsigned long disp_clk_regs[] __initconst = {
  2307. DISP_PLL_LOCK,
  2308. DISP_PLL_CON0,
  2309. DISP_PLL_CON1,
  2310. DISP_PLL_FREQ_DET,
  2311. MUX_SEL_DISP0,
  2312. MUX_SEL_DISP1,
  2313. MUX_SEL_DISP2,
  2314. MUX_SEL_DISP3,
  2315. MUX_SEL_DISP4,
  2316. MUX_ENABLE_DISP0,
  2317. MUX_ENABLE_DISP1,
  2318. MUX_ENABLE_DISP2,
  2319. MUX_ENABLE_DISP3,
  2320. MUX_ENABLE_DISP4,
  2321. MUX_IGNORE_DISP2,
  2322. DIV_DISP,
  2323. DIV_DISP_PLL_FREQ_DET,
  2324. ENABLE_ACLK_DISP0,
  2325. ENABLE_ACLK_DISP1,
  2326. ENABLE_PCLK_DISP,
  2327. ENABLE_SCLK_DISP,
  2328. ENABLE_IP_DISP0,
  2329. ENABLE_IP_DISP1,
  2330. CLKOUT_CMU_DISP,
  2331. CLKOUT_CMU_DISP_DIV_STAT,
  2332. };
  2333. /* list of all parent clock list */
  2334. PNAME(mout_disp_pll_p) = { "oscclk", "fout_disp_pll", };
  2335. PNAME(mout_sclk_dsim1_user_p) = { "oscclk", "sclk_dsim1_disp", };
  2336. PNAME(mout_sclk_dsim0_user_p) = { "oscclk", "sclk_dsim0_disp", };
  2337. PNAME(mout_sclk_dsd_user_p) = { "oscclk", "sclk_dsd_disp", };
  2338. PNAME(mout_sclk_decon_tv_eclk_user_p) = { "oscclk",
  2339. "sclk_decon_tv_eclk_disp", };
  2340. PNAME(mout_sclk_decon_vclk_user_p) = { "oscclk",
  2341. "sclk_decon_vclk_disp", };
  2342. PNAME(mout_sclk_decon_eclk_user_p) = { "oscclk",
  2343. "sclk_decon_eclk_disp", };
  2344. PNAME(mout_sclk_decon_tv_vlkc_user_p) = { "oscclk",
  2345. "sclk_decon_tv_vclk_disp", };
  2346. PNAME(mout_aclk_disp_333_user_p) = { "oscclk", "aclk_disp_333", };
  2347. PNAME(mout_phyclk_mipidphy1_bitclkdiv8_user_p) = { "oscclk",
  2348. "phyclk_mipidphy1_bitclkdiv8_phy", };
  2349. PNAME(mout_phyclk_mipidphy1_rxclkesc0_user_p) = { "oscclk",
  2350. "phyclk_mipidphy1_rxclkesc0_phy", };
  2351. PNAME(mout_phyclk_mipidphy0_bitclkdiv8_user_p) = { "oscclk",
  2352. "phyclk_mipidphy0_bitclkdiv8_phy", };
  2353. PNAME(mout_phyclk_mipidphy0_rxclkesc0_user_p) = { "oscclk",
  2354. "phyclk_mipidphy0_rxclkesc0_phy", };
  2355. PNAME(mout_phyclk_hdmiphy_tmds_clko_user_p) = { "oscclk",
  2356. "phyclk_hdmiphy_tmds_clko_phy", };
  2357. PNAME(mout_phyclk_hdmiphy_pixel_clko_user_p) = { "oscclk",
  2358. "phyclk_hdmiphy_pixel_clko_phy", };
  2359. PNAME(mout_sclk_dsim0_p) = { "mout_disp_pll",
  2360. "mout_sclk_dsim0_user", };
  2361. PNAME(mout_sclk_decon_tv_eclk_p) = { "mout_disp_pll",
  2362. "mout_sclk_decon_tv_eclk_user", };
  2363. PNAME(mout_sclk_decon_vclk_p) = { "mout_disp_pll",
  2364. "mout_sclk_decon_vclk_user", };
  2365. PNAME(mout_sclk_decon_eclk_p) = { "mout_disp_pll",
  2366. "mout_sclk_decon_eclk_user", };
  2367. PNAME(mout_sclk_dsim1_b_disp_p) = { "mout_sclk_dsim1_a_disp",
  2368. "mout_sclk_dsim1_user", };
  2369. PNAME(mout_sclk_decon_tv_vclk_c_disp_p) = {
  2370. "mout_phyclk_hdmiphy_pixel_clko_user",
  2371. "mout_sclk_decon_tv_vclk_b_disp", };
  2372. PNAME(mout_sclk_decon_tv_vclk_b_disp_p) = { "mout_sclk_decon_tv_vclk_a_disp",
  2373. "mout_sclk_decon_tv_vclk_user", };
  2374. static const struct samsung_pll_clock disp_pll_clks[] __initconst = {
  2375. PLL(pll_35xx, CLK_FOUT_DISP_PLL, "fout_disp_pll", "oscclk",
  2376. DISP_PLL_LOCK, DISP_PLL_CON0, exynos5433_pll_rates),
  2377. };
  2378. static const struct samsung_fixed_factor_clock disp_fixed_factor_clks[] __initconst = {
  2379. /*
  2380. * sclk_rgb_{vclk|tv_vclk} is half clock of sclk_decon_{vclk|tv_vclk}.
  2381. * The divider has fixed value (2) between sclk_rgb_{vclk|tv_vclk}
  2382. * and sclk_decon_{vclk|tv_vclk}.
  2383. */
  2384. FFACTOR(CLK_SCLK_RGB_VCLK, "sclk_rgb_vclk", "sclk_decon_vclk",
  2385. 1, 2, 0),
  2386. FFACTOR(CLK_SCLK_RGB_TV_VCLK, "sclk_rgb_tv_vclk", "sclk_decon_tv_vclk",
  2387. 1, 2, 0),
  2388. };
  2389. static const struct samsung_fixed_rate_clock disp_fixed_clks[] __initconst = {
  2390. /* PHY clocks from MIPI_DPHY1 */
  2391. FRATE(0, "phyclk_mipidphy1_bitclkdiv8_phy", NULL, 0, 188000000),
  2392. FRATE(0, "phyclk_mipidphy1_rxclkesc0_phy", NULL, 0, 100000000),
  2393. /* PHY clocks from MIPI_DPHY0 */
  2394. FRATE(CLK_PHYCLK_MIPIDPHY0_BITCLKDIV8_PHY, "phyclk_mipidphy0_bitclkdiv8_phy",
  2395. NULL, 0, 188000000),
  2396. FRATE(CLK_PHYCLK_MIPIDPHY0_RXCLKESC0_PHY, "phyclk_mipidphy0_rxclkesc0_phy",
  2397. NULL, 0, 100000000),
  2398. /* PHY clocks from HDMI_PHY */
  2399. FRATE(CLK_PHYCLK_HDMIPHY_TMDS_CLKO_PHY, "phyclk_hdmiphy_tmds_clko_phy",
  2400. NULL, 0, 300000000),
  2401. FRATE(CLK_PHYCLK_HDMIPHY_PIXEL_CLKO_PHY, "phyclk_hdmiphy_pixel_clko_phy",
  2402. NULL, 0, 166000000),
  2403. };
  2404. static const struct samsung_mux_clock disp_mux_clks[] __initconst = {
  2405. /* MUX_SEL_DISP0 */
  2406. MUX(CLK_MOUT_DISP_PLL, "mout_disp_pll", mout_disp_pll_p, MUX_SEL_DISP0,
  2407. 0, 1),
  2408. /* MUX_SEL_DISP1 */
  2409. MUX(CLK_MOUT_SCLK_DSIM1_USER, "mout_sclk_dsim1_user",
  2410. mout_sclk_dsim1_user_p, MUX_SEL_DISP1, 28, 1),
  2411. MUX(CLK_MOUT_SCLK_DSIM0_USER, "mout_sclk_dsim0_user",
  2412. mout_sclk_dsim0_user_p, MUX_SEL_DISP1, 24, 1),
  2413. MUX(CLK_MOUT_SCLK_DSD_USER, "mout_sclk_dsd_user", mout_sclk_dsd_user_p,
  2414. MUX_SEL_DISP1, 20, 1),
  2415. MUX(CLK_MOUT_SCLK_DECON_TV_ECLK_USER, "mout_sclk_decon_tv_eclk_user",
  2416. mout_sclk_decon_tv_eclk_user_p, MUX_SEL_DISP1, 16, 1),
  2417. MUX(CLK_MOUT_SCLK_DECON_VCLK_USER, "mout_sclk_decon_vclk_user",
  2418. mout_sclk_decon_vclk_user_p, MUX_SEL_DISP1, 12, 1),
  2419. MUX(CLK_MOUT_SCLK_DECON_ECLK_USER, "mout_sclk_decon_eclk_user",
  2420. mout_sclk_decon_eclk_user_p, MUX_SEL_DISP1, 8, 1),
  2421. MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_USER, "mout_sclk_decon_tv_vclk_user",
  2422. mout_sclk_decon_tv_vlkc_user_p, MUX_SEL_DISP1, 4, 1),
  2423. MUX(CLK_MOUT_ACLK_DISP_333_USER, "mout_aclk_disp_333_user",
  2424. mout_aclk_disp_333_user_p, MUX_SEL_DISP1, 0, 1),
  2425. /* MUX_SEL_DISP2 */
  2426. MUX(CLK_MOUT_PHYCLK_MIPIDPHY1_BITCLKDIV8_USER,
  2427. "mout_phyclk_mipidphy1_bitclkdiv8_user",
  2428. mout_phyclk_mipidphy1_bitclkdiv8_user_p, MUX_SEL_DISP2,
  2429. 20, 1),
  2430. MUX(CLK_MOUT_PHYCLK_MIPIDPHY1_RXCLKESC0_USER,
  2431. "mout_phyclk_mipidphy1_rxclkesc0_user",
  2432. mout_phyclk_mipidphy1_rxclkesc0_user_p, MUX_SEL_DISP2,
  2433. 16, 1),
  2434. MUX(CLK_MOUT_PHYCLK_MIPIDPHY0_BITCLKDIV8_USER,
  2435. "mout_phyclk_mipidphy0_bitclkdiv8_user",
  2436. mout_phyclk_mipidphy0_bitclkdiv8_user_p, MUX_SEL_DISP2,
  2437. 12, 1),
  2438. MUX(CLK_MOUT_PHYCLK_MIPIDPHY0_RXCLKESC0_USER,
  2439. "mout_phyclk_mipidphy0_rxclkesc0_user",
  2440. mout_phyclk_mipidphy0_rxclkesc0_user_p, MUX_SEL_DISP2,
  2441. 8, 1),
  2442. MUX(CLK_MOUT_PHYCLK_HDMIPHY_TMDS_CLKO_USER,
  2443. "mout_phyclk_hdmiphy_tmds_clko_user",
  2444. mout_phyclk_hdmiphy_tmds_clko_user_p, MUX_SEL_DISP2,
  2445. 4, 1),
  2446. MUX(CLK_MOUT_PHYCLK_HDMIPHY_PIXEL_CLKO_USER,
  2447. "mout_phyclk_hdmiphy_pixel_clko_user",
  2448. mout_phyclk_hdmiphy_pixel_clko_user_p, MUX_SEL_DISP2,
  2449. 0, 1),
  2450. /* MUX_SEL_DISP3 */
  2451. MUX(CLK_MOUT_SCLK_DSIM0, "mout_sclk_dsim0", mout_sclk_dsim0_p,
  2452. MUX_SEL_DISP3, 12, 1),
  2453. MUX(CLK_MOUT_SCLK_DECON_TV_ECLK, "mout_sclk_decon_tv_eclk",
  2454. mout_sclk_decon_tv_eclk_p, MUX_SEL_DISP3, 8, 1),
  2455. MUX(CLK_MOUT_SCLK_DECON_VCLK, "mout_sclk_decon_vclk",
  2456. mout_sclk_decon_vclk_p, MUX_SEL_DISP3, 4, 1),
  2457. MUX(CLK_MOUT_SCLK_DECON_ECLK, "mout_sclk_decon_eclk",
  2458. mout_sclk_decon_eclk_p, MUX_SEL_DISP3, 0, 1),
  2459. /* MUX_SEL_DISP4 */
  2460. MUX(CLK_MOUT_SCLK_DSIM1_B_DISP, "mout_sclk_dsim1_b_disp",
  2461. mout_sclk_dsim1_b_disp_p, MUX_SEL_DISP4, 16, 1),
  2462. MUX(CLK_MOUT_SCLK_DSIM1_A_DISP, "mout_sclk_dsim1_a_disp",
  2463. mout_sclk_dsim0_p, MUX_SEL_DISP4, 12, 1),
  2464. MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_C_DISP,
  2465. "mout_sclk_decon_tv_vclk_c_disp",
  2466. mout_sclk_decon_tv_vclk_c_disp_p, MUX_SEL_DISP4, 8, 1),
  2467. MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_B_DISP,
  2468. "mout_sclk_decon_tv_vclk_b_disp",
  2469. mout_sclk_decon_tv_vclk_b_disp_p, MUX_SEL_DISP4, 4, 1),
  2470. MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_A_DISP,
  2471. "mout_sclk_decon_tv_vclk_a_disp",
  2472. mout_sclk_decon_vclk_p, MUX_SEL_DISP4, 0, 1),
  2473. };
  2474. static const struct samsung_div_clock disp_div_clks[] __initconst = {
  2475. /* DIV_DISP */
  2476. DIV(CLK_DIV_SCLK_DSIM1_DISP, "div_sclk_dsim1_disp",
  2477. "mout_sclk_dsim1_b_disp", DIV_DISP, 24, 3),
  2478. DIV(CLK_DIV_SCLK_DECON_TV_VCLK_DISP, "div_sclk_decon_tv_vclk_disp",
  2479. "mout_sclk_decon_tv_vclk_c_disp", DIV_DISP, 20, 3),
  2480. DIV(CLK_DIV_SCLK_DSIM0_DISP, "div_sclk_dsim0_disp", "mout_sclk_dsim0",
  2481. DIV_DISP, 16, 3),
  2482. DIV(CLK_DIV_SCLK_DECON_TV_ECLK_DISP, "div_sclk_decon_tv_eclk_disp",
  2483. "mout_sclk_decon_tv_eclk", DIV_DISP, 12, 3),
  2484. DIV(CLK_DIV_SCLK_DECON_VCLK_DISP, "div_sclk_decon_vclk_disp",
  2485. "mout_sclk_decon_vclk", DIV_DISP, 8, 3),
  2486. DIV(CLK_DIV_SCLK_DECON_ECLK_DISP, "div_sclk_decon_eclk_disp",
  2487. "mout_sclk_decon_eclk", DIV_DISP, 4, 3),
  2488. DIV(CLK_DIV_PCLK_DISP, "div_pclk_disp", "mout_aclk_disp_333_user",
  2489. DIV_DISP, 0, 2),
  2490. };
  2491. static const struct samsung_gate_clock disp_gate_clks[] __initconst = {
  2492. /* ENABLE_ACLK_DISP0 */
  2493. GATE(CLK_ACLK_DECON_TV, "aclk_decon_tv", "mout_aclk_disp_333_user",
  2494. ENABLE_ACLK_DISP0, 2, 0, 0),
  2495. GATE(CLK_ACLK_DECON, "aclk_decon", "mout_aclk_disp_333_user",
  2496. ENABLE_ACLK_DISP0, 0, 0, 0),
  2497. /* ENABLE_ACLK_DISP1 */
  2498. GATE(CLK_ACLK_SMMU_TV1X, "aclk_smmu_tv1x", "mout_aclk_disp_333_user",
  2499. ENABLE_ACLK_DISP1, 25, 0, 0),
  2500. GATE(CLK_ACLK_SMMU_TV0X, "aclk_smmu_tv0x", "mout_aclk_disp_333_user",
  2501. ENABLE_ACLK_DISP1, 24, 0, 0),
  2502. GATE(CLK_ACLK_SMMU_DECON1X, "aclk_smmu_decon1x",
  2503. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 23, 0, 0),
  2504. GATE(CLK_ACLK_SMMU_DECON0X, "aclk_smmu_decon0x",
  2505. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 22, 0, 0),
  2506. GATE(CLK_ACLK_BTS_DECON_TV_M3, "aclk_bts_decon_tv_m3",
  2507. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 21, 0, 0),
  2508. GATE(CLK_ACLK_BTS_DECON_TV_M2, "aclk_bts_decon_tv_m2",
  2509. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 20, 0, 0),
  2510. GATE(CLK_ACLK_BTS_DECON_TV_M1, "aclk_bts_decon_tv_m1",
  2511. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 19, 0, 0),
  2512. GATE(CLK_ACLK_BTS_DECON_TV_M0, "aclk-bts_decon_tv_m0",
  2513. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 18, 0, 0),
  2514. GATE(CLK_ACLK_BTS_DECON_NM4, "aclk_bts_decon_nm4",
  2515. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 17, 0, 0),
  2516. GATE(CLK_ACLK_BTS_DECON_NM3, "aclk_bts_decon_nm3",
  2517. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 16, 0, 0),
  2518. GATE(CLK_ACLK_BTS_DECON_NM2, "aclk_bts_decon_nm2",
  2519. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 15, 0, 0),
  2520. GATE(CLK_ACLK_BTS_DECON_NM1, "aclk_bts_decon_nm1",
  2521. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 14, 0, 0),
  2522. GATE(CLK_ACLK_BTS_DECON_NM0, "aclk_bts_decon_nm0",
  2523. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 13, 0, 0),
  2524. GATE(CLK_ACLK_AHB2APB_DISPSFR2P, "aclk_ahb2apb_dispsfr2p",
  2525. "div_pclk_disp", ENABLE_ACLK_DISP1,
  2526. 12, CLK_IGNORE_UNUSED, 0),
  2527. GATE(CLK_ACLK_AHB2APB_DISPSFR1P, "aclk_ahb2apb_dispsfr1p",
  2528. "div_pclk_disp", ENABLE_ACLK_DISP1,
  2529. 11, CLK_IGNORE_UNUSED, 0),
  2530. GATE(CLK_ACLK_AHB2APB_DISPSFR0P, "aclk_ahb2apb_dispsfr0p",
  2531. "div_pclk_disp", ENABLE_ACLK_DISP1,
  2532. 10, CLK_IGNORE_UNUSED, 0),
  2533. GATE(CLK_ACLK_AHB_DISPH, "aclk_ahb_disph", "div_pclk_disp",
  2534. ENABLE_ACLK_DISP1, 8, CLK_IGNORE_UNUSED, 0),
  2535. GATE(CLK_ACLK_XIU_TV1X, "aclk_xiu_tv1x", "mout_aclk_disp_333_user",
  2536. ENABLE_ACLK_DISP1, 7, 0, 0),
  2537. GATE(CLK_ACLK_XIU_TV0X, "aclk_xiu_tv0x", "mout_aclk_disp_333_user",
  2538. ENABLE_ACLK_DISP1, 6, 0, 0),
  2539. GATE(CLK_ACLK_XIU_DECON1X, "aclk_xiu_decon1x",
  2540. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 5, 0, 0),
  2541. GATE(CLK_ACLK_XIU_DECON0X, "aclk_xiu_decon0x",
  2542. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 4, 0, 0),
  2543. GATE(CLK_ACLK_XIU_DISP1X, "aclk_xiu_disp1x", "mout_aclk_disp_333_user",
  2544. ENABLE_ACLK_DISP1, 3, CLK_IGNORE_UNUSED, 0),
  2545. GATE(CLK_ACLK_XIU_DISPNP_100, "aclk_xiu_dispnp_100", "div_pclk_disp",
  2546. ENABLE_ACLK_DISP1, 2, CLK_IGNORE_UNUSED, 0),
  2547. GATE(CLK_ACLK_DISP1ND_333, "aclk_disp1nd_333",
  2548. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 1,
  2549. CLK_IGNORE_UNUSED, 0),
  2550. GATE(CLK_ACLK_DISP0ND_333, "aclk_disp0nd_333",
  2551. "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1,
  2552. 0, CLK_IGNORE_UNUSED, 0),
  2553. /* ENABLE_PCLK_DISP */
  2554. GATE(CLK_PCLK_SMMU_TV1X, "pclk_smmu_tv1x", "div_pclk_disp",
  2555. ENABLE_PCLK_DISP, 23, 0, 0),
  2556. GATE(CLK_PCLK_SMMU_TV0X, "pclk_smmu_tv0x", "div_pclk_disp",
  2557. ENABLE_PCLK_DISP, 22, 0, 0),
  2558. GATE(CLK_PCLK_SMMU_DECON1X, "pclk_smmu_decon1x", "div_pclk_disp",
  2559. ENABLE_PCLK_DISP, 21, 0, 0),
  2560. GATE(CLK_PCLK_SMMU_DECON0X, "pclk_smmu_decon0x", "div_pclk_disp",
  2561. ENABLE_PCLK_DISP, 20, 0, 0),
  2562. GATE(CLK_PCLK_BTS_DECON_TV_M3, "pclk_bts_decon_tv_m3", "div_pclk_disp",
  2563. ENABLE_PCLK_DISP, 19, 0, 0),
  2564. GATE(CLK_PCLK_BTS_DECON_TV_M2, "pclk_bts_decon_tv_m2", "div_pclk_disp",
  2565. ENABLE_PCLK_DISP, 18, 0, 0),
  2566. GATE(CLK_PCLK_BTS_DECON_TV_M1, "pclk_bts_decon_tv_m1", "div_pclk_disp",
  2567. ENABLE_PCLK_DISP, 17, 0, 0),
  2568. GATE(CLK_PCLK_BTS_DECON_TV_M0, "pclk_bts_decon_tv_m0", "div_pclk_disp",
  2569. ENABLE_PCLK_DISP, 16, 0, 0),
  2570. GATE(CLK_PCLK_BTS_DECONM4, "pclk_bts_deconm4", "div_pclk_disp",
  2571. ENABLE_PCLK_DISP, 15, 0, 0),
  2572. GATE(CLK_PCLK_BTS_DECONM3, "pclk_bts_deconm3", "div_pclk_disp",
  2573. ENABLE_PCLK_DISP, 14, 0, 0),
  2574. GATE(CLK_PCLK_BTS_DECONM2, "pclk_bts_deconm2", "div_pclk_disp",
  2575. ENABLE_PCLK_DISP, 13, 0, 0),
  2576. GATE(CLK_PCLK_BTS_DECONM1, "pclk_bts_deconm1", "div_pclk_disp",
  2577. ENABLE_PCLK_DISP, 12, 0, 0),
  2578. GATE(CLK_PCLK_BTS_DECONM0, "pclk_bts_deconm0", "div_pclk_disp",
  2579. ENABLE_PCLK_DISP, 11, 0, 0),
  2580. GATE(CLK_PCLK_MIC1, "pclk_mic1", "div_pclk_disp",
  2581. ENABLE_PCLK_DISP, 10, 0, 0),
  2582. GATE(CLK_PCLK_PMU_DISP, "pclk_pmu_disp", "div_pclk_disp",
  2583. ENABLE_PCLK_DISP, 9, CLK_IGNORE_UNUSED, 0),
  2584. GATE(CLK_PCLK_SYSREG_DISP, "pclk_sysreg_disp", "div_pclk_disp",
  2585. ENABLE_PCLK_DISP, 8, CLK_IGNORE_UNUSED, 0),
  2586. GATE(CLK_PCLK_HDMIPHY, "pclk_hdmiphy", "div_pclk_disp",
  2587. ENABLE_PCLK_DISP, 7, 0, 0),
  2588. GATE(CLK_PCLK_HDMI, "pclk_hdmi", "div_pclk_disp",
  2589. ENABLE_PCLK_DISP, 6, 0, 0),
  2590. GATE(CLK_PCLK_MIC0, "pclk_mic0", "div_pclk_disp",
  2591. ENABLE_PCLK_DISP, 5, 0, 0),
  2592. GATE(CLK_PCLK_DSIM1, "pclk_dsim1", "div_pclk_disp",
  2593. ENABLE_PCLK_DISP, 3, 0, 0),
  2594. GATE(CLK_PCLK_DSIM0, "pclk_dsim0", "div_pclk_disp",
  2595. ENABLE_PCLK_DISP, 2, 0, 0),
  2596. GATE(CLK_PCLK_DECON_TV, "pclk_decon_tv", "div_pclk_disp",
  2597. ENABLE_PCLK_DISP, 1, 0, 0),
  2598. GATE(CLK_PCLK_DECON, "pclk_decon", "div_pclk_disp",
  2599. ENABLE_PCLK_DISP, 0, 0, 0),
  2600. /* ENABLE_SCLK_DISP */
  2601. GATE(CLK_PHYCLK_MIPIDPHY1_BITCLKDIV8, "phyclk_mipidphy1_bitclkdiv8",
  2602. "mout_phyclk_mipidphy1_bitclkdiv8_user",
  2603. ENABLE_SCLK_DISP, 26, 0, 0),
  2604. GATE(CLK_PHYCLK_MIPIDPHY1_RXCLKESC0, "phyclk_mipidphy1_rxclkesc0",
  2605. "mout_phyclk_mipidphy1_rxclkesc0_user",
  2606. ENABLE_SCLK_DISP, 25, 0, 0),
  2607. GATE(CLK_SCLK_RGB_TV_VCLK_TO_DSIM1, "sclk_rgb_tv_vclk_to_dsim1",
  2608. "sclk_rgb_tv_vclk", ENABLE_SCLK_DISP, 24, 0, 0),
  2609. GATE(CLK_SCLK_RGB_TV_VCLK_TO_MIC1, "sclk_rgb_tv_vclk_to_mic1",
  2610. "sclk_rgb_tv_vclk", ENABLE_SCLK_DISP, 23, 0, 0),
  2611. GATE(CLK_SCLK_DSIM1, "sclk_dsim1", "div_sclk_dsim1_disp",
  2612. ENABLE_SCLK_DISP, 22, 0, 0),
  2613. GATE(CLK_SCLK_DECON_TV_VCLK, "sclk_decon_tv_vclk",
  2614. "div_sclk_decon_tv_vclk_disp",
  2615. ENABLE_SCLK_DISP, 21, 0, 0),
  2616. GATE(CLK_PHYCLK_MIPIDPHY0_BITCLKDIV8, "phyclk_mipidphy0_bitclkdiv8",
  2617. "mout_phyclk_mipidphy0_bitclkdiv8_user",
  2618. ENABLE_SCLK_DISP, 15, 0, 0),
  2619. GATE(CLK_PHYCLK_MIPIDPHY0_RXCLKESC0, "phyclk_mipidphy0_rxclkesc0",
  2620. "mout_phyclk_mipidphy0_rxclkesc0_user",
  2621. ENABLE_SCLK_DISP, 14, 0, 0),
  2622. GATE(CLK_PHYCLK_HDMIPHY_TMDS_CLKO, "phyclk_hdmiphy_tmds_clko",
  2623. "mout_phyclk_hdmiphy_tmds_clko_user",
  2624. ENABLE_SCLK_DISP, 13, 0, 0),
  2625. GATE(CLK_PHYCLK_HDMI_PIXEL, "phyclk_hdmi_pixel",
  2626. "sclk_rgb_tv_vclk", ENABLE_SCLK_DISP, 12, 0, 0),
  2627. GATE(CLK_SCLK_RGB_VCLK_TO_SMIES, "sclk_rgb_vclk_to_smies",
  2628. "sclk_rgb_vclk", ENABLE_SCLK_DISP, 11, 0, 0),
  2629. GATE(CLK_SCLK_RGB_VCLK_TO_DSIM0, "sclk_rgb_vclk_to_dsim0",
  2630. "sclk_rgb_vclk", ENABLE_SCLK_DISP, 9, 0, 0),
  2631. GATE(CLK_SCLK_RGB_VCLK_TO_MIC0, "sclk_rgb_vclk_to_mic0",
  2632. "sclk_rgb_vclk", ENABLE_SCLK_DISP, 8, 0, 0),
  2633. GATE(CLK_SCLK_DSD, "sclk_dsd", "mout_sclk_dsd_user",
  2634. ENABLE_SCLK_DISP, 7, 0, 0),
  2635. GATE(CLK_SCLK_HDMI_SPDIF, "sclk_hdmi_spdif", "sclk_hdmi_spdif_disp",
  2636. ENABLE_SCLK_DISP, 6, 0, 0),
  2637. GATE(CLK_SCLK_DSIM0, "sclk_dsim0", "div_sclk_dsim0_disp",
  2638. ENABLE_SCLK_DISP, 5, 0, 0),
  2639. GATE(CLK_SCLK_DECON_TV_ECLK, "sclk_decon_tv_eclk",
  2640. "div_sclk_decon_tv_eclk_disp",
  2641. ENABLE_SCLK_DISP, 4, 0, 0),
  2642. GATE(CLK_SCLK_DECON_VCLK, "sclk_decon_vclk",
  2643. "div_sclk_decon_vclk_disp", ENABLE_SCLK_DISP, 3, 0, 0),
  2644. GATE(CLK_SCLK_DECON_ECLK, "sclk_decon_eclk",
  2645. "div_sclk_decon_eclk_disp", ENABLE_SCLK_DISP, 2, 0, 0),
  2646. };
  2647. static const struct samsung_cmu_info disp_cmu_info __initconst = {
  2648. .pll_clks = disp_pll_clks,
  2649. .nr_pll_clks = ARRAY_SIZE(disp_pll_clks),
  2650. .mux_clks = disp_mux_clks,
  2651. .nr_mux_clks = ARRAY_SIZE(disp_mux_clks),
  2652. .div_clks = disp_div_clks,
  2653. .nr_div_clks = ARRAY_SIZE(disp_div_clks),
  2654. .gate_clks = disp_gate_clks,
  2655. .nr_gate_clks = ARRAY_SIZE(disp_gate_clks),
  2656. .fixed_clks = disp_fixed_clks,
  2657. .nr_fixed_clks = ARRAY_SIZE(disp_fixed_clks),
  2658. .fixed_factor_clks = disp_fixed_factor_clks,
  2659. .nr_fixed_factor_clks = ARRAY_SIZE(disp_fixed_factor_clks),
  2660. .nr_clk_ids = DISP_NR_CLK,
  2661. .clk_regs = disp_clk_regs,
  2662. .nr_clk_regs = ARRAY_SIZE(disp_clk_regs),
  2663. };
  2664. static void __init exynos5433_cmu_disp_init(struct device_node *np)
  2665. {
  2666. samsung_cmu_register_one(np, &disp_cmu_info);
  2667. }
  2668. CLK_OF_DECLARE(exynos5433_cmu_disp, "samsung,exynos5433-cmu-disp",
  2669. exynos5433_cmu_disp_init);
  2670. /*
  2671. * Register offset definitions for CMU_AUD
  2672. */
  2673. #define MUX_SEL_AUD0 0x0200
  2674. #define MUX_SEL_AUD1 0x0204
  2675. #define MUX_ENABLE_AUD0 0x0300
  2676. #define MUX_ENABLE_AUD1 0x0304
  2677. #define MUX_STAT_AUD0 0x0400
  2678. #define DIV_AUD0 0x0600
  2679. #define DIV_AUD1 0x0604
  2680. #define DIV_STAT_AUD0 0x0700
  2681. #define DIV_STAT_AUD1 0x0704
  2682. #define ENABLE_ACLK_AUD 0x0800
  2683. #define ENABLE_PCLK_AUD 0x0900
  2684. #define ENABLE_SCLK_AUD0 0x0a00
  2685. #define ENABLE_SCLK_AUD1 0x0a04
  2686. #define ENABLE_IP_AUD0 0x0b00
  2687. #define ENABLE_IP_AUD1 0x0b04
  2688. static const unsigned long aud_clk_regs[] __initconst = {
  2689. MUX_SEL_AUD0,
  2690. MUX_SEL_AUD1,
  2691. MUX_ENABLE_AUD0,
  2692. MUX_ENABLE_AUD1,
  2693. DIV_AUD0,
  2694. DIV_AUD1,
  2695. ENABLE_ACLK_AUD,
  2696. ENABLE_PCLK_AUD,
  2697. ENABLE_SCLK_AUD0,
  2698. ENABLE_SCLK_AUD1,
  2699. ENABLE_IP_AUD0,
  2700. ENABLE_IP_AUD1,
  2701. };
  2702. /* list of all parent clock list */
  2703. PNAME(mout_aud_pll_user_aud_p) = { "oscclk", "fout_aud_pll", };
  2704. PNAME(mout_sclk_aud_pcm_p) = { "mout_aud_pll_user", "ioclk_audiocdclk0",};
  2705. static const struct samsung_fixed_rate_clock aud_fixed_clks[] __initconst = {
  2706. FRATE(0, "ioclk_jtag_tclk", NULL, 0, 33000000),
  2707. FRATE(0, "ioclk_slimbus_clk", NULL, 0, 25000000),
  2708. FRATE(0, "ioclk_i2s_bclk", NULL, 0, 50000000),
  2709. };
  2710. static const struct samsung_mux_clock aud_mux_clks[] __initconst = {
  2711. /* MUX_SEL_AUD0 */
  2712. MUX(CLK_MOUT_AUD_PLL_USER, "mout_aud_pll_user",
  2713. mout_aud_pll_user_aud_p, MUX_SEL_AUD0, 0, 1),
  2714. /* MUX_SEL_AUD1 */
  2715. MUX(CLK_MOUT_SCLK_AUD_PCM, "mout_sclk_aud_pcm", mout_sclk_aud_pcm_p,
  2716. MUX_SEL_AUD1, 8, 1),
  2717. MUX(CLK_MOUT_SCLK_AUD_I2S, "mout_sclk_aud_i2s", mout_sclk_aud_pcm_p,
  2718. MUX_SEL_AUD1, 0, 1),
  2719. };
  2720. static const struct samsung_div_clock aud_div_clks[] __initconst = {
  2721. /* DIV_AUD0 */
  2722. DIV(CLK_DIV_ATCLK_AUD, "div_atclk_aud", "div_aud_ca5", DIV_AUD0,
  2723. 12, 4),
  2724. DIV(CLK_DIV_PCLK_DBG_AUD, "div_pclk_dbg_aud", "div_aud_ca5", DIV_AUD0,
  2725. 8, 4),
  2726. DIV(CLK_DIV_ACLK_AUD, "div_aclk_aud", "div_aud_ca5", DIV_AUD0,
  2727. 4, 4),
  2728. DIV(CLK_DIV_AUD_CA5, "div_aud_ca5", "mout_aud_pll_user", DIV_AUD0,
  2729. 0, 4),
  2730. /* DIV_AUD1 */
  2731. DIV(CLK_DIV_SCLK_AUD_SLIMBUS, "div_sclk_aud_slimbus",
  2732. "mout_aud_pll_user", DIV_AUD1, 16, 5),
  2733. DIV(CLK_DIV_SCLK_AUD_UART, "div_sclk_aud_uart", "mout_aud_pll_user",
  2734. DIV_AUD1, 12, 4),
  2735. DIV(CLK_DIV_SCLK_AUD_PCM, "div_sclk_aud_pcm", "mout_sclk_aud_pcm",
  2736. DIV_AUD1, 4, 8),
  2737. DIV(CLK_DIV_SCLK_AUD_I2S, "div_sclk_aud_i2s", "mout_sclk_aud_i2s",
  2738. DIV_AUD1, 0, 4),
  2739. };
  2740. static const struct samsung_gate_clock aud_gate_clks[] __initconst = {
  2741. /* ENABLE_ACLK_AUD */
  2742. GATE(CLK_ACLK_INTR_CTRL, "aclk_intr_ctrl", "div_aclk_aud",
  2743. ENABLE_ACLK_AUD, 12, 0, 0),
  2744. GATE(CLK_ACLK_SMMU_LPASSX, "aclk_smmu_lpassx", "div_aclk_aud",
  2745. ENABLE_ACLK_AUD, 7, 0, 0),
  2746. GATE(CLK_ACLK_XIU_LPASSX, "aclk_xiu_lpassx", "div_aclk_aud",
  2747. ENABLE_ACLK_AUD, 0, 4, 0),
  2748. GATE(CLK_ACLK_AUDNP_133, "aclk_audnp_133", "div_aclk_aud",
  2749. ENABLE_ACLK_AUD, 0, 3, 0),
  2750. GATE(CLK_ACLK_AUDND_133, "aclk_audnd_133", "div_aclk_aud",
  2751. ENABLE_ACLK_AUD, 0, 2, 0),
  2752. GATE(CLK_ACLK_SRAMC, "aclk_sramc", "div_aclk_aud", ENABLE_ACLK_AUD,
  2753. 0, 1, 0),
  2754. GATE(CLK_ACLK_DMAC, "aclk_dmac", "div_aclk_aud", ENABLE_ACLK_AUD,
  2755. 0, CLK_IGNORE_UNUSED, 0),
  2756. /* ENABLE_PCLK_AUD */
  2757. GATE(CLK_PCLK_WDT1, "pclk_wdt1", "div_aclk_aud", ENABLE_PCLK_AUD,
  2758. 13, 0, 0),
  2759. GATE(CLK_PCLK_WDT0, "pclk_wdt0", "div_aclk_aud", ENABLE_PCLK_AUD,
  2760. 12, 0, 0),
  2761. GATE(CLK_PCLK_SFR1, "pclk_sfr1", "div_aclk_aud", ENABLE_PCLK_AUD,
  2762. 11, 0, 0),
  2763. GATE(CLK_PCLK_SMMU_LPASSX, "pclk_smmu_lpassx", "div_aclk_aud",
  2764. ENABLE_PCLK_AUD, 10, 0, 0),
  2765. GATE(CLK_PCLK_GPIO_AUD, "pclk_gpio_aud", "div_aclk_aud",
  2766. ENABLE_PCLK_AUD, 9, CLK_IGNORE_UNUSED, 0),
  2767. GATE(CLK_PCLK_PMU_AUD, "pclk_pmu_aud", "div_aclk_aud",
  2768. ENABLE_PCLK_AUD, 8, CLK_IGNORE_UNUSED, 0),
  2769. GATE(CLK_PCLK_SYSREG_AUD, "pclk_sysreg_aud", "div_aclk_aud",
  2770. ENABLE_PCLK_AUD, 7, CLK_IGNORE_UNUSED, 0),
  2771. GATE(CLK_PCLK_AUD_SLIMBUS, "pclk_aud_slimbus", "div_aclk_aud",
  2772. ENABLE_PCLK_AUD, 6, 0, 0),
  2773. GATE(CLK_PCLK_AUD_UART, "pclk_aud_uart", "div_aclk_aud",
  2774. ENABLE_PCLK_AUD, 5, 0, 0),
  2775. GATE(CLK_PCLK_AUD_PCM, "pclk_aud_pcm", "div_aclk_aud",
  2776. ENABLE_PCLK_AUD, 4, 0, 0),
  2777. GATE(CLK_PCLK_AUD_I2S, "pclk_aud_i2s", "div_aclk_aud",
  2778. ENABLE_PCLK_AUD, 3, 0, 0),
  2779. GATE(CLK_PCLK_TIMER, "pclk_timer", "div_aclk_aud", ENABLE_PCLK_AUD,
  2780. 2, 0, 0),
  2781. GATE(CLK_PCLK_SFR0_CTRL, "pclk_sfr0_ctrl", "div_aclk_aud",
  2782. ENABLE_PCLK_AUD, 0, 0, 0),
  2783. /* ENABLE_SCLK_AUD0 */
  2784. GATE(CLK_ATCLK_AUD, "atclk_aud", "div_atclk_aud", ENABLE_SCLK_AUD0,
  2785. 2, CLK_IGNORE_UNUSED, 0),
  2786. GATE(CLK_PCLK_DBG_AUD, "pclk_dbg_aud", "div_pclk_dbg_aud",
  2787. ENABLE_SCLK_AUD0, 1, 0, 0),
  2788. GATE(CLK_SCLK_AUD_CA5, "sclk_aud_ca5", "div_aud_ca5", ENABLE_SCLK_AUD0,
  2789. 0, 0, 0),
  2790. /* ENABLE_SCLK_AUD1 */
  2791. GATE(CLK_SCLK_JTAG_TCK, "sclk_jtag_tck", "ioclk_jtag_tclk",
  2792. ENABLE_SCLK_AUD1, 6, 0, 0),
  2793. GATE(CLK_SCLK_SLIMBUS_CLKIN, "sclk_slimbus_clkin", "ioclk_slimbus_clk",
  2794. ENABLE_SCLK_AUD1, 5, 0, 0),
  2795. GATE(CLK_SCLK_AUD_SLIMBUS, "sclk_aud_slimbus", "div_sclk_aud_slimbus",
  2796. ENABLE_SCLK_AUD1, 4, 0, 0),
  2797. GATE(CLK_SCLK_AUD_UART, "sclk_aud_uart", "div_sclk_aud_uart",
  2798. ENABLE_SCLK_AUD1, 3, CLK_IGNORE_UNUSED, 0),
  2799. GATE(CLK_SCLK_AUD_PCM, "sclk_aud_pcm", "div_sclk_aud_pcm",
  2800. ENABLE_SCLK_AUD1, 2, 0, 0),
  2801. GATE(CLK_SCLK_I2S_BCLK, "sclk_i2s_bclk", "ioclk_i2s_bclk",
  2802. ENABLE_SCLK_AUD1, 1, CLK_IGNORE_UNUSED, 0),
  2803. GATE(CLK_SCLK_AUD_I2S, "sclk_aud_i2s", "div_sclk_aud_i2s",
  2804. ENABLE_SCLK_AUD1, 0, CLK_IGNORE_UNUSED, 0),
  2805. };
  2806. static const struct samsung_cmu_info aud_cmu_info __initconst = {
  2807. .mux_clks = aud_mux_clks,
  2808. .nr_mux_clks = ARRAY_SIZE(aud_mux_clks),
  2809. .div_clks = aud_div_clks,
  2810. .nr_div_clks = ARRAY_SIZE(aud_div_clks),
  2811. .gate_clks = aud_gate_clks,
  2812. .nr_gate_clks = ARRAY_SIZE(aud_gate_clks),
  2813. .fixed_clks = aud_fixed_clks,
  2814. .nr_fixed_clks = ARRAY_SIZE(aud_fixed_clks),
  2815. .nr_clk_ids = AUD_NR_CLK,
  2816. .clk_regs = aud_clk_regs,
  2817. .nr_clk_regs = ARRAY_SIZE(aud_clk_regs),
  2818. };
  2819. static void __init exynos5433_cmu_aud_init(struct device_node *np)
  2820. {
  2821. samsung_cmu_register_one(np, &aud_cmu_info);
  2822. }
  2823. CLK_OF_DECLARE(exynos5433_cmu_aud, "samsung,exynos5433-cmu-aud",
  2824. exynos5433_cmu_aud_init);
  2825. /*
  2826. * Register offset definitions for CMU_BUS{0|1|2}
  2827. */
  2828. #define DIV_BUS 0x0600
  2829. #define DIV_STAT_BUS 0x0700
  2830. #define ENABLE_ACLK_BUS 0x0800
  2831. #define ENABLE_PCLK_BUS 0x0900
  2832. #define ENABLE_IP_BUS0 0x0b00
  2833. #define ENABLE_IP_BUS1 0x0b04
  2834. #define MUX_SEL_BUS2 0x0200 /* Only for CMU_BUS2 */
  2835. #define MUX_ENABLE_BUS2 0x0300 /* Only for CMU_BUS2 */
  2836. #define MUX_STAT_BUS2 0x0400 /* Only for CMU_BUS2 */
  2837. /* list of all parent clock list */
  2838. PNAME(mout_aclk_bus2_400_p) = { "oscclk", "aclk_bus2_400", };
  2839. #define CMU_BUS_COMMON_CLK_REGS \
  2840. DIV_BUS, \
  2841. ENABLE_ACLK_BUS, \
  2842. ENABLE_PCLK_BUS, \
  2843. ENABLE_IP_BUS0, \
  2844. ENABLE_IP_BUS1
  2845. static const unsigned long bus01_clk_regs[] __initconst = {
  2846. CMU_BUS_COMMON_CLK_REGS,
  2847. };
  2848. static const unsigned long bus2_clk_regs[] __initconst = {
  2849. MUX_SEL_BUS2,
  2850. MUX_ENABLE_BUS2,
  2851. CMU_BUS_COMMON_CLK_REGS,
  2852. };
  2853. static const struct samsung_div_clock bus0_div_clks[] __initconst = {
  2854. /* DIV_BUS0 */
  2855. DIV(CLK_DIV_PCLK_BUS_133, "div_pclk_bus0_133", "aclk_bus0_400",
  2856. DIV_BUS, 0, 3),
  2857. };
  2858. /* CMU_BUS0 clocks */
  2859. static const struct samsung_gate_clock bus0_gate_clks[] __initconst = {
  2860. /* ENABLE_ACLK_BUS0 */
  2861. GATE(CLK_ACLK_AHB2APB_BUSP, "aclk_ahb2apb_bus0p", "div_pclk_bus0_133",
  2862. ENABLE_ACLK_BUS, 4, CLK_IGNORE_UNUSED, 0),
  2863. GATE(CLK_ACLK_BUSNP_133, "aclk_bus0np_133", "div_pclk_bus0_133",
  2864. ENABLE_ACLK_BUS, 2, CLK_IGNORE_UNUSED, 0),
  2865. GATE(CLK_ACLK_BUSND_400, "aclk_bus0nd_400", "aclk_bus0_400",
  2866. ENABLE_ACLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
  2867. /* ENABLE_PCLK_BUS0 */
  2868. GATE(CLK_PCLK_BUSSRVND_133, "pclk_bus0srvnd_133", "div_pclk_bus0_133",
  2869. ENABLE_PCLK_BUS, 2, 0, 0),
  2870. GATE(CLK_PCLK_PMU_BUS, "pclk_pmu_bus0", "div_pclk_bus0_133",
  2871. ENABLE_PCLK_BUS, 1, CLK_IGNORE_UNUSED, 0),
  2872. GATE(CLK_PCLK_SYSREG_BUS, "pclk_sysreg_bus0", "div_pclk_bus0_133",
  2873. ENABLE_PCLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
  2874. };
  2875. /* CMU_BUS1 clocks */
  2876. static const struct samsung_div_clock bus1_div_clks[] __initconst = {
  2877. /* DIV_BUS1 */
  2878. DIV(CLK_DIV_PCLK_BUS_133, "div_pclk_bus1_133", "aclk_bus1_400",
  2879. DIV_BUS, 0, 3),
  2880. };
  2881. static const struct samsung_gate_clock bus1_gate_clks[] __initconst = {
  2882. /* ENABLE_ACLK_BUS1 */
  2883. GATE(CLK_ACLK_AHB2APB_BUSP, "aclk_ahb2apb_bus1p", "div_pclk_bus1_133",
  2884. ENABLE_ACLK_BUS, 4, CLK_IGNORE_UNUSED, 0),
  2885. GATE(CLK_ACLK_BUSNP_133, "aclk_bus1np_133", "div_pclk_bus1_133",
  2886. ENABLE_ACLK_BUS, 2, CLK_IGNORE_UNUSED, 0),
  2887. GATE(CLK_ACLK_BUSND_400, "aclk_bus1nd_400", "aclk_bus1_400",
  2888. ENABLE_ACLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
  2889. /* ENABLE_PCLK_BUS1 */
  2890. GATE(CLK_PCLK_BUSSRVND_133, "pclk_bus1srvnd_133", "div_pclk_bus1_133",
  2891. ENABLE_PCLK_BUS, 2, 0, 0),
  2892. GATE(CLK_PCLK_PMU_BUS, "pclk_pmu_bus1", "div_pclk_bus1_133",
  2893. ENABLE_PCLK_BUS, 1, CLK_IGNORE_UNUSED, 0),
  2894. GATE(CLK_PCLK_SYSREG_BUS, "pclk_sysreg_bus1", "div_pclk_bus1_133",
  2895. ENABLE_PCLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
  2896. };
  2897. /* CMU_BUS2 clocks */
  2898. static const struct samsung_mux_clock bus2_mux_clks[] __initconst = {
  2899. /* MUX_SEL_BUS2 */
  2900. MUX(CLK_MOUT_ACLK_BUS2_400_USER, "mout_aclk_bus2_400_user",
  2901. mout_aclk_bus2_400_p, MUX_SEL_BUS2, 0, 1),
  2902. };
  2903. static const struct samsung_div_clock bus2_div_clks[] __initconst = {
  2904. /* DIV_BUS2 */
  2905. DIV(CLK_DIV_PCLK_BUS_133, "div_pclk_bus2_133",
  2906. "mout_aclk_bus2_400_user", DIV_BUS, 0, 3),
  2907. };
  2908. static const struct samsung_gate_clock bus2_gate_clks[] __initconst = {
  2909. /* ENABLE_ACLK_BUS2 */
  2910. GATE(CLK_ACLK_AHB2APB_BUSP, "aclk_ahb2apb_bus2p", "div_pclk_bus2_133",
  2911. ENABLE_ACLK_BUS, 3, CLK_IGNORE_UNUSED, 0),
  2912. GATE(CLK_ACLK_BUSNP_133, "aclk_bus2np_133", "div_pclk_bus2_133",
  2913. ENABLE_ACLK_BUS, 2, CLK_IGNORE_UNUSED, 0),
  2914. GATE(CLK_ACLK_BUS2BEND_400, "aclk_bus2bend_400",
  2915. "mout_aclk_bus2_400_user", ENABLE_ACLK_BUS,
  2916. 1, CLK_IGNORE_UNUSED, 0),
  2917. GATE(CLK_ACLK_BUS2RTND_400, "aclk_bus2rtnd_400",
  2918. "mout_aclk_bus2_400_user", ENABLE_ACLK_BUS,
  2919. 0, CLK_IGNORE_UNUSED, 0),
  2920. /* ENABLE_PCLK_BUS2 */
  2921. GATE(CLK_PCLK_BUSSRVND_133, "pclk_bus2srvnd_133", "div_pclk_bus2_133",
  2922. ENABLE_PCLK_BUS, 2, 0, 0),
  2923. GATE(CLK_PCLK_PMU_BUS, "pclk_pmu_bus2", "div_pclk_bus2_133",
  2924. ENABLE_PCLK_BUS, 1, CLK_IGNORE_UNUSED, 0),
  2925. GATE(CLK_PCLK_SYSREG_BUS, "pclk_sysreg_bus2", "div_pclk_bus2_133",
  2926. ENABLE_PCLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
  2927. };
  2928. #define CMU_BUS_INFO_CLKS(id) \
  2929. .div_clks = bus##id##_div_clks, \
  2930. .nr_div_clks = ARRAY_SIZE(bus##id##_div_clks), \
  2931. .gate_clks = bus##id##_gate_clks, \
  2932. .nr_gate_clks = ARRAY_SIZE(bus##id##_gate_clks), \
  2933. .nr_clk_ids = BUSx_NR_CLK
  2934. static const struct samsung_cmu_info bus0_cmu_info __initconst = {
  2935. CMU_BUS_INFO_CLKS(0),
  2936. .clk_regs = bus01_clk_regs,
  2937. .nr_clk_regs = ARRAY_SIZE(bus01_clk_regs),
  2938. };
  2939. static const struct samsung_cmu_info bus1_cmu_info __initconst = {
  2940. CMU_BUS_INFO_CLKS(1),
  2941. .clk_regs = bus01_clk_regs,
  2942. .nr_clk_regs = ARRAY_SIZE(bus01_clk_regs),
  2943. };
  2944. static const struct samsung_cmu_info bus2_cmu_info __initconst = {
  2945. CMU_BUS_INFO_CLKS(2),
  2946. .mux_clks = bus2_mux_clks,
  2947. .nr_mux_clks = ARRAY_SIZE(bus2_mux_clks),
  2948. .clk_regs = bus2_clk_regs,
  2949. .nr_clk_regs = ARRAY_SIZE(bus2_clk_regs),
  2950. };
  2951. #define exynos5433_cmu_bus_init(id) \
  2952. static void __init exynos5433_cmu_bus##id##_init(struct device_node *np)\
  2953. { \
  2954. samsung_cmu_register_one(np, &bus##id##_cmu_info); \
  2955. } \
  2956. CLK_OF_DECLARE(exynos5433_cmu_bus##id, \
  2957. "samsung,exynos5433-cmu-bus"#id, \
  2958. exynos5433_cmu_bus##id##_init)
  2959. exynos5433_cmu_bus_init(0);
  2960. exynos5433_cmu_bus_init(1);
  2961. exynos5433_cmu_bus_init(2);
  2962. /*
  2963. * Register offset definitions for CMU_G3D
  2964. */
  2965. #define G3D_PLL_LOCK 0x0000
  2966. #define G3D_PLL_CON0 0x0100
  2967. #define G3D_PLL_CON1 0x0104
  2968. #define G3D_PLL_FREQ_DET 0x010c
  2969. #define MUX_SEL_G3D 0x0200
  2970. #define MUX_ENABLE_G3D 0x0300
  2971. #define MUX_STAT_G3D 0x0400
  2972. #define DIV_G3D 0x0600
  2973. #define DIV_G3D_PLL_FREQ_DET 0x0604
  2974. #define DIV_STAT_G3D 0x0700
  2975. #define DIV_STAT_G3D_PLL_FREQ_DET 0x0704
  2976. #define ENABLE_ACLK_G3D 0x0800
  2977. #define ENABLE_PCLK_G3D 0x0900
  2978. #define ENABLE_SCLK_G3D 0x0a00
  2979. #define ENABLE_IP_G3D0 0x0b00
  2980. #define ENABLE_IP_G3D1 0x0b04
  2981. #define CLKOUT_CMU_G3D 0x0c00
  2982. #define CLKOUT_CMU_G3D_DIV_STAT 0x0c04
  2983. #define CLK_STOPCTRL 0x1000
  2984. static const unsigned long g3d_clk_regs[] __initconst = {
  2985. G3D_PLL_LOCK,
  2986. G3D_PLL_CON0,
  2987. G3D_PLL_CON1,
  2988. G3D_PLL_FREQ_DET,
  2989. MUX_SEL_G3D,
  2990. MUX_ENABLE_G3D,
  2991. DIV_G3D,
  2992. DIV_G3D_PLL_FREQ_DET,
  2993. ENABLE_ACLK_G3D,
  2994. ENABLE_PCLK_G3D,
  2995. ENABLE_SCLK_G3D,
  2996. ENABLE_IP_G3D0,
  2997. ENABLE_IP_G3D1,
  2998. CLKOUT_CMU_G3D,
  2999. CLKOUT_CMU_G3D_DIV_STAT,
  3000. CLK_STOPCTRL,
  3001. };
  3002. /* list of all parent clock list */
  3003. PNAME(mout_aclk_g3d_400_p) = { "mout_g3d_pll", "aclk_g3d_400", };
  3004. PNAME(mout_g3d_pll_p) = { "oscclk", "fout_g3d_pll", };
  3005. static const struct samsung_pll_clock g3d_pll_clks[] __initconst = {
  3006. PLL(pll_35xx, CLK_FOUT_G3D_PLL, "fout_g3d_pll", "oscclk",
  3007. G3D_PLL_LOCK, G3D_PLL_CON0, exynos5433_pll_rates),
  3008. };
  3009. static const struct samsung_mux_clock g3d_mux_clks[] __initconst = {
  3010. /* MUX_SEL_G3D */
  3011. MUX_F(CLK_MOUT_ACLK_G3D_400, "mout_aclk_g3d_400", mout_aclk_g3d_400_p,
  3012. MUX_SEL_G3D, 8, 1, CLK_SET_RATE_PARENT, 0),
  3013. MUX_F(CLK_MOUT_G3D_PLL, "mout_g3d_pll", mout_g3d_pll_p,
  3014. MUX_SEL_G3D, 0, 1, CLK_SET_RATE_PARENT, 0),
  3015. };
  3016. static const struct samsung_div_clock g3d_div_clks[] __initconst = {
  3017. /* DIV_G3D */
  3018. DIV(CLK_DIV_SCLK_HPM_G3D, "div_sclk_hpm_g3d", "mout_g3d_pll", DIV_G3D,
  3019. 8, 2),
  3020. DIV(CLK_DIV_PCLK_G3D, "div_pclk_g3d", "div_aclk_g3d", DIV_G3D,
  3021. 4, 3),
  3022. DIV_F(CLK_DIV_ACLK_G3D, "div_aclk_g3d", "mout_aclk_g3d_400", DIV_G3D,
  3023. 0, 3, CLK_SET_RATE_PARENT, 0),
  3024. };
  3025. static const struct samsung_gate_clock g3d_gate_clks[] __initconst = {
  3026. /* ENABLE_ACLK_G3D */
  3027. GATE(CLK_ACLK_BTS_G3D1, "aclk_bts_g3d1", "div_aclk_g3d",
  3028. ENABLE_ACLK_G3D, 7, 0, 0),
  3029. GATE(CLK_ACLK_BTS_G3D0, "aclk_bts_g3d0", "div_aclk_g3d",
  3030. ENABLE_ACLK_G3D, 6, 0, 0),
  3031. GATE(CLK_ACLK_ASYNCAPBS_G3D, "aclk_asyncapbs_g3d", "div_pclk_g3d",
  3032. ENABLE_ACLK_G3D, 5, CLK_IGNORE_UNUSED, 0),
  3033. GATE(CLK_ACLK_ASYNCAPBM_G3D, "aclk_asyncapbm_g3d", "div_aclk_g3d",
  3034. ENABLE_ACLK_G3D, 4, CLK_IGNORE_UNUSED, 0),
  3035. GATE(CLK_ACLK_AHB2APB_G3DP, "aclk_ahb2apb_g3dp", "div_pclk_g3d",
  3036. ENABLE_ACLK_G3D, 3, CLK_IGNORE_UNUSED, 0),
  3037. GATE(CLK_ACLK_G3DNP_150, "aclk_g3dnp_150", "div_pclk_g3d",
  3038. ENABLE_ACLK_G3D, 2, CLK_IGNORE_UNUSED, 0),
  3039. GATE(CLK_ACLK_G3DND_600, "aclk_g3dnd_600", "div_aclk_g3d",
  3040. ENABLE_ACLK_G3D, 1, CLK_IGNORE_UNUSED, 0),
  3041. GATE(CLK_ACLK_G3D, "aclk_g3d", "div_aclk_g3d",
  3042. ENABLE_ACLK_G3D, 0, CLK_SET_RATE_PARENT, 0),
  3043. /* ENABLE_PCLK_G3D */
  3044. GATE(CLK_PCLK_BTS_G3D1, "pclk_bts_g3d1", "div_pclk_g3d",
  3045. ENABLE_PCLK_G3D, 3, 0, 0),
  3046. GATE(CLK_PCLK_BTS_G3D0, "pclk_bts_g3d0", "div_pclk_g3d",
  3047. ENABLE_PCLK_G3D, 2, 0, 0),
  3048. GATE(CLK_PCLK_PMU_G3D, "pclk_pmu_g3d", "div_pclk_g3d",
  3049. ENABLE_PCLK_G3D, 1, CLK_IGNORE_UNUSED, 0),
  3050. GATE(CLK_PCLK_SYSREG_G3D, "pclk_sysreg_g3d", "div_pclk_g3d",
  3051. ENABLE_PCLK_G3D, 0, CLK_IGNORE_UNUSED, 0),
  3052. /* ENABLE_SCLK_G3D */
  3053. GATE(CLK_SCLK_HPM_G3D, "sclk_hpm_g3d", "div_sclk_hpm_g3d",
  3054. ENABLE_SCLK_G3D, 0, 0, 0),
  3055. };
  3056. static const struct samsung_cmu_info g3d_cmu_info __initconst = {
  3057. .pll_clks = g3d_pll_clks,
  3058. .nr_pll_clks = ARRAY_SIZE(g3d_pll_clks),
  3059. .mux_clks = g3d_mux_clks,
  3060. .nr_mux_clks = ARRAY_SIZE(g3d_mux_clks),
  3061. .div_clks = g3d_div_clks,
  3062. .nr_div_clks = ARRAY_SIZE(g3d_div_clks),
  3063. .gate_clks = g3d_gate_clks,
  3064. .nr_gate_clks = ARRAY_SIZE(g3d_gate_clks),
  3065. .nr_clk_ids = G3D_NR_CLK,
  3066. .clk_regs = g3d_clk_regs,
  3067. .nr_clk_regs = ARRAY_SIZE(g3d_clk_regs),
  3068. };
  3069. static void __init exynos5433_cmu_g3d_init(struct device_node *np)
  3070. {
  3071. samsung_cmu_register_one(np, &g3d_cmu_info);
  3072. }
  3073. CLK_OF_DECLARE(exynos5433_cmu_g3d, "samsung,exynos5433-cmu-g3d",
  3074. exynos5433_cmu_g3d_init);
  3075. /*
  3076. * Register offset definitions for CMU_GSCL
  3077. */
  3078. #define MUX_SEL_GSCL 0x0200
  3079. #define MUX_ENABLE_GSCL 0x0300
  3080. #define MUX_STAT_GSCL 0x0400
  3081. #define ENABLE_ACLK_GSCL 0x0800
  3082. #define ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL0 0x0804
  3083. #define ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL1 0x0808
  3084. #define ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL2 0x080c
  3085. #define ENABLE_PCLK_GSCL 0x0900
  3086. #define ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL0 0x0904
  3087. #define ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL1 0x0908
  3088. #define ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL2 0x090c
  3089. #define ENABLE_IP_GSCL0 0x0b00
  3090. #define ENABLE_IP_GSCL1 0x0b04
  3091. #define ENABLE_IP_GSCL_SECURE_SMMU_GSCL0 0x0b08
  3092. #define ENABLE_IP_GSCL_SECURE_SMMU_GSCL1 0x0b0c
  3093. #define ENABLE_IP_GSCL_SECURE_SMMU_GSCL2 0x0b10
  3094. static const unsigned long gscl_clk_regs[] __initconst = {
  3095. MUX_SEL_GSCL,
  3096. MUX_ENABLE_GSCL,
  3097. ENABLE_ACLK_GSCL,
  3098. ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL0,
  3099. ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL1,
  3100. ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL2,
  3101. ENABLE_PCLK_GSCL,
  3102. ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL0,
  3103. ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL1,
  3104. ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL2,
  3105. ENABLE_IP_GSCL0,
  3106. ENABLE_IP_GSCL1,
  3107. ENABLE_IP_GSCL_SECURE_SMMU_GSCL0,
  3108. ENABLE_IP_GSCL_SECURE_SMMU_GSCL1,
  3109. ENABLE_IP_GSCL_SECURE_SMMU_GSCL2,
  3110. };
  3111. /* list of all parent clock list */
  3112. PNAME(aclk_gscl_111_user_p) = { "oscclk", "aclk_gscl_111", };
  3113. PNAME(aclk_gscl_333_user_p) = { "oscclk", "aclk_gscl_333", };
  3114. static const struct samsung_mux_clock gscl_mux_clks[] __initconst = {
  3115. /* MUX_SEL_GSCL */
  3116. MUX(CLK_MOUT_ACLK_GSCL_111_USER, "mout_aclk_gscl_111_user",
  3117. aclk_gscl_111_user_p, MUX_SEL_GSCL, 4, 1),
  3118. MUX(CLK_MOUT_ACLK_GSCL_333_USER, "mout_aclk_gscl_333_user",
  3119. aclk_gscl_333_user_p, MUX_SEL_GSCL, 0, 1),
  3120. };
  3121. static const struct samsung_gate_clock gscl_gate_clks[] __initconst = {
  3122. /* ENABLE_ACLK_GSCL */
  3123. GATE(CLK_ACLK_BTS_GSCL2, "aclk_bts_gscl2", "mout_aclk_gscl_333_user",
  3124. ENABLE_ACLK_GSCL, 11, 0, 0),
  3125. GATE(CLK_ACLK_BTS_GSCL1, "aclk_bts_gscl1", "mout_aclk_gscl_333_user",
  3126. ENABLE_ACLK_GSCL, 10, 0, 0),
  3127. GATE(CLK_ACLK_BTS_GSCL0, "aclk_bts_gscl0", "mout_aclk_gscl_333_user",
  3128. ENABLE_ACLK_GSCL, 9, 0, 0),
  3129. GATE(CLK_ACLK_AHB2APB_GSCLP, "aclk_ahb2apb_gsclp",
  3130. "mout_aclk_gscl_111_user", ENABLE_ACLK_GSCL,
  3131. 8, CLK_IGNORE_UNUSED, 0),
  3132. GATE(CLK_ACLK_XIU_GSCLX, "aclk_xiu_gsclx", "mout_aclk_gscl_333_user",
  3133. ENABLE_ACLK_GSCL, 7, 0, 0),
  3134. GATE(CLK_ACLK_GSCLNP_111, "aclk_gsclnp_111", "mout_aclk_gscl_111_user",
  3135. ENABLE_ACLK_GSCL, 6, CLK_IGNORE_UNUSED, 0),
  3136. GATE(CLK_ACLK_GSCLRTND_333, "aclk_gsclrtnd_333",
  3137. "mout_aclk_gscl_333_user", ENABLE_ACLK_GSCL, 5,
  3138. CLK_IGNORE_UNUSED, 0),
  3139. GATE(CLK_ACLK_GSCLBEND_333, "aclk_gsclbend_333",
  3140. "mout_aclk_gscl_333_user", ENABLE_ACLK_GSCL, 4,
  3141. CLK_IGNORE_UNUSED, 0),
  3142. GATE(CLK_ACLK_GSD, "aclk_gsd", "mout_aclk_gscl_333_user",
  3143. ENABLE_ACLK_GSCL, 3, 0, 0),
  3144. GATE(CLK_ACLK_GSCL2, "aclk_gscl2", "mout_aclk_gscl_333_user",
  3145. ENABLE_ACLK_GSCL, 2, 0, 0),
  3146. GATE(CLK_ACLK_GSCL1, "aclk_gscl1", "mout_aclk_gscl_333_user",
  3147. ENABLE_ACLK_GSCL, 1, 0, 0),
  3148. GATE(CLK_ACLK_GSCL0, "aclk_gscl0", "mout_aclk_gscl_333_user",
  3149. ENABLE_ACLK_GSCL, 0, 0, 0),
  3150. /* ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL0 */
  3151. GATE(CLK_ACLK_SMMU_GSCL0, "aclk_smmu_gscl0", "mout_aclk_gscl_333_user",
  3152. ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL0, 0, 0, 0),
  3153. /* ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL1 */
  3154. GATE(CLK_ACLK_SMMU_GSCL1, "aclk_smmu_gscl1", "mout_aclk_gscl_333_user",
  3155. ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL1, 0, 0, 0),
  3156. /* ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL2 */
  3157. GATE(CLK_ACLK_SMMU_GSCL2, "aclk_smmu_gscl2", "mout_aclk_gscl_333_user",
  3158. ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL2, 0, 0, 0),
  3159. /* ENABLE_PCLK_GSCL */
  3160. GATE(CLK_PCLK_BTS_GSCL2, "pclk_bts_gscl2", "mout_aclk_gscl_111_user",
  3161. ENABLE_PCLK_GSCL, 7, 0, 0),
  3162. GATE(CLK_PCLK_BTS_GSCL1, "pclk_bts_gscl1", "mout_aclk_gscl_111_user",
  3163. ENABLE_PCLK_GSCL, 6, 0, 0),
  3164. GATE(CLK_PCLK_BTS_GSCL0, "pclk_bts_gscl0", "mout_aclk_gscl_111_user",
  3165. ENABLE_PCLK_GSCL, 5, 0, 0),
  3166. GATE(CLK_PCLK_PMU_GSCL, "pclk_pmu_gscl", "mout_aclk_gscl_111_user",
  3167. ENABLE_PCLK_GSCL, 4, CLK_IGNORE_UNUSED, 0),
  3168. GATE(CLK_PCLK_SYSREG_GSCL, "pclk_sysreg_gscl",
  3169. "mout_aclk_gscl_111_user", ENABLE_PCLK_GSCL,
  3170. 3, CLK_IGNORE_UNUSED, 0),
  3171. GATE(CLK_PCLK_GSCL2, "pclk_gscl2", "mout_aclk_gscl_111_user",
  3172. ENABLE_PCLK_GSCL, 2, 0, 0),
  3173. GATE(CLK_PCLK_GSCL1, "pclk_gscl1", "mout_aclk_gscl_111_user",
  3174. ENABLE_PCLK_GSCL, 1, 0, 0),
  3175. GATE(CLK_PCLK_GSCL0, "pclk_gscl0", "mout_aclk_gscl_111_user",
  3176. ENABLE_PCLK_GSCL, 0, 0, 0),
  3177. /* ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL0 */
  3178. GATE(CLK_PCLK_SMMU_GSCL0, "pclk_smmu_gscl0", "mout_aclk_gscl_111_user",
  3179. ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL0, 0, 0, 0),
  3180. /* ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL1 */
  3181. GATE(CLK_PCLK_SMMU_GSCL1, "pclk_smmu_gscl1", "mout_aclk_gscl_111_user",
  3182. ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL1, 0, 0, 0),
  3183. /* ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL2 */
  3184. GATE(CLK_PCLK_SMMU_GSCL2, "pclk_smmu_gscl2", "mout_aclk_gscl_111_user",
  3185. ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL2, 0, 0, 0),
  3186. };
  3187. static const struct samsung_cmu_info gscl_cmu_info __initconst = {
  3188. .mux_clks = gscl_mux_clks,
  3189. .nr_mux_clks = ARRAY_SIZE(gscl_mux_clks),
  3190. .gate_clks = gscl_gate_clks,
  3191. .nr_gate_clks = ARRAY_SIZE(gscl_gate_clks),
  3192. .nr_clk_ids = GSCL_NR_CLK,
  3193. .clk_regs = gscl_clk_regs,
  3194. .nr_clk_regs = ARRAY_SIZE(gscl_clk_regs),
  3195. };
  3196. static void __init exynos5433_cmu_gscl_init(struct device_node *np)
  3197. {
  3198. samsung_cmu_register_one(np, &gscl_cmu_info);
  3199. }
  3200. CLK_OF_DECLARE(exynos5433_cmu_gscl, "samsung,exynos5433-cmu-gscl",
  3201. exynos5433_cmu_gscl_init);
  3202. /*
  3203. * Register offset definitions for CMU_APOLLO
  3204. */
  3205. #define APOLLO_PLL_LOCK 0x0000
  3206. #define APOLLO_PLL_CON0 0x0100
  3207. #define APOLLO_PLL_CON1 0x0104
  3208. #define APOLLO_PLL_FREQ_DET 0x010c
  3209. #define MUX_SEL_APOLLO0 0x0200
  3210. #define MUX_SEL_APOLLO1 0x0204
  3211. #define MUX_SEL_APOLLO2 0x0208
  3212. #define MUX_ENABLE_APOLLO0 0x0300
  3213. #define MUX_ENABLE_APOLLO1 0x0304
  3214. #define MUX_ENABLE_APOLLO2 0x0308
  3215. #define MUX_STAT_APOLLO0 0x0400
  3216. #define MUX_STAT_APOLLO1 0x0404
  3217. #define MUX_STAT_APOLLO2 0x0408
  3218. #define DIV_APOLLO0 0x0600
  3219. #define DIV_APOLLO1 0x0604
  3220. #define DIV_APOLLO_PLL_FREQ_DET 0x0608
  3221. #define DIV_STAT_APOLLO0 0x0700
  3222. #define DIV_STAT_APOLLO1 0x0704
  3223. #define DIV_STAT_APOLLO_PLL_FREQ_DET 0x0708
  3224. #define ENABLE_ACLK_APOLLO 0x0800
  3225. #define ENABLE_PCLK_APOLLO 0x0900
  3226. #define ENABLE_SCLK_APOLLO 0x0a00
  3227. #define ENABLE_IP_APOLLO0 0x0b00
  3228. #define ENABLE_IP_APOLLO1 0x0b04
  3229. #define CLKOUT_CMU_APOLLO 0x0c00
  3230. #define CLKOUT_CMU_APOLLO_DIV_STAT 0x0c04
  3231. #define ARMCLK_STOPCTRL 0x1000
  3232. #define APOLLO_PWR_CTRL 0x1020
  3233. #define APOLLO_PWR_CTRL2 0x1024
  3234. #define APOLLO_INTR_SPREAD_ENABLE 0x1080
  3235. #define APOLLO_INTR_SPREAD_USE_STANDBYWFI 0x1084
  3236. #define APOLLO_INTR_SPREAD_BLOCKING_DURATION 0x1088
  3237. static const unsigned long apollo_clk_regs[] __initconst = {
  3238. APOLLO_PLL_LOCK,
  3239. APOLLO_PLL_CON0,
  3240. APOLLO_PLL_CON1,
  3241. APOLLO_PLL_FREQ_DET,
  3242. MUX_SEL_APOLLO0,
  3243. MUX_SEL_APOLLO1,
  3244. MUX_SEL_APOLLO2,
  3245. MUX_ENABLE_APOLLO0,
  3246. MUX_ENABLE_APOLLO1,
  3247. MUX_ENABLE_APOLLO2,
  3248. DIV_APOLLO0,
  3249. DIV_APOLLO1,
  3250. DIV_APOLLO_PLL_FREQ_DET,
  3251. ENABLE_ACLK_APOLLO,
  3252. ENABLE_PCLK_APOLLO,
  3253. ENABLE_SCLK_APOLLO,
  3254. ENABLE_IP_APOLLO0,
  3255. ENABLE_IP_APOLLO1,
  3256. CLKOUT_CMU_APOLLO,
  3257. CLKOUT_CMU_APOLLO_DIV_STAT,
  3258. ARMCLK_STOPCTRL,
  3259. APOLLO_PWR_CTRL,
  3260. APOLLO_PWR_CTRL2,
  3261. APOLLO_INTR_SPREAD_ENABLE,
  3262. APOLLO_INTR_SPREAD_USE_STANDBYWFI,
  3263. APOLLO_INTR_SPREAD_BLOCKING_DURATION,
  3264. };
  3265. /* list of all parent clock list */
  3266. PNAME(mout_apollo_pll_p) = { "oscclk", "fout_apollo_pll", };
  3267. PNAME(mout_bus_pll_apollo_user_p) = { "oscclk", "sclk_bus_pll_apollo", };
  3268. PNAME(mout_apollo_p) = { "mout_apollo_pll",
  3269. "mout_bus_pll_apollo_user", };
  3270. static const struct samsung_pll_clock apollo_pll_clks[] __initconst = {
  3271. PLL(pll_35xx, CLK_FOUT_APOLLO_PLL, "fout_apollo_pll", "oscclk",
  3272. APOLLO_PLL_LOCK, APOLLO_PLL_CON0, exynos5433_pll_rates),
  3273. };
  3274. static const struct samsung_mux_clock apollo_mux_clks[] __initconst = {
  3275. /* MUX_SEL_APOLLO0 */
  3276. MUX_F(CLK_MOUT_APOLLO_PLL, "mout_apollo_pll", mout_apollo_pll_p,
  3277. MUX_SEL_APOLLO0, 0, 1, CLK_SET_RATE_PARENT |
  3278. CLK_RECALC_NEW_RATES, 0),
  3279. /* MUX_SEL_APOLLO1 */
  3280. MUX(CLK_MOUT_BUS_PLL_APOLLO_USER, "mout_bus_pll_apollo_user",
  3281. mout_bus_pll_apollo_user_p, MUX_SEL_APOLLO1, 0, 1),
  3282. /* MUX_SEL_APOLLO2 */
  3283. MUX_F(CLK_MOUT_APOLLO, "mout_apollo", mout_apollo_p, MUX_SEL_APOLLO2,
  3284. 0, 1, CLK_SET_RATE_PARENT, 0),
  3285. };
  3286. static const struct samsung_div_clock apollo_div_clks[] __initconst = {
  3287. /* DIV_APOLLO0 */
  3288. DIV_F(CLK_DIV_CNTCLK_APOLLO, "div_cntclk_apollo", "div_apollo2",
  3289. DIV_APOLLO0, 24, 3, CLK_GET_RATE_NOCACHE,
  3290. CLK_DIVIDER_READ_ONLY),
  3291. DIV_F(CLK_DIV_PCLK_DBG_APOLLO, "div_pclk_dbg_apollo", "div_apollo2",
  3292. DIV_APOLLO0, 20, 3, CLK_GET_RATE_NOCACHE,
  3293. CLK_DIVIDER_READ_ONLY),
  3294. DIV_F(CLK_DIV_ATCLK_APOLLO, "div_atclk_apollo", "div_apollo2",
  3295. DIV_APOLLO0, 16, 3, CLK_GET_RATE_NOCACHE,
  3296. CLK_DIVIDER_READ_ONLY),
  3297. DIV_F(CLK_DIV_PCLK_APOLLO, "div_pclk_apollo", "div_apollo2",
  3298. DIV_APOLLO0, 12, 3, CLK_GET_RATE_NOCACHE,
  3299. CLK_DIVIDER_READ_ONLY),
  3300. DIV_F(CLK_DIV_ACLK_APOLLO, "div_aclk_apollo", "div_apollo2",
  3301. DIV_APOLLO0, 8, 3, CLK_GET_RATE_NOCACHE,
  3302. CLK_DIVIDER_READ_ONLY),
  3303. DIV_F(CLK_DIV_APOLLO2, "div_apollo2", "div_apollo1",
  3304. DIV_APOLLO0, 4, 3, CLK_SET_RATE_PARENT, 0),
  3305. DIV_F(CLK_DIV_APOLLO1, "div_apollo1", "mout_apollo",
  3306. DIV_APOLLO0, 0, 3, CLK_SET_RATE_PARENT, 0),
  3307. /* DIV_APOLLO1 */
  3308. DIV_F(CLK_DIV_SCLK_HPM_APOLLO, "div_sclk_hpm_apollo", "mout_apollo",
  3309. DIV_APOLLO1, 4, 3, CLK_GET_RATE_NOCACHE,
  3310. CLK_DIVIDER_READ_ONLY),
  3311. DIV_F(CLK_DIV_APOLLO_PLL, "div_apollo_pll", "mout_apollo",
  3312. DIV_APOLLO1, 0, 3, CLK_GET_RATE_NOCACHE,
  3313. CLK_DIVIDER_READ_ONLY),
  3314. };
  3315. static const struct samsung_gate_clock apollo_gate_clks[] __initconst = {
  3316. /* ENABLE_ACLK_APOLLO */
  3317. GATE(CLK_ACLK_ASATBSLV_APOLLO_3_CSSYS, "aclk_asatbslv_apollo_3_cssys",
  3318. "div_atclk_apollo", ENABLE_ACLK_APOLLO,
  3319. 6, CLK_IGNORE_UNUSED, 0),
  3320. GATE(CLK_ACLK_ASATBSLV_APOLLO_2_CSSYS, "aclk_asatbslv_apollo_2_cssys",
  3321. "div_atclk_apollo", ENABLE_ACLK_APOLLO,
  3322. 5, CLK_IGNORE_UNUSED, 0),
  3323. GATE(CLK_ACLK_ASATBSLV_APOLLO_1_CSSYS, "aclk_asatbslv_apollo_1_cssys",
  3324. "div_atclk_apollo", ENABLE_ACLK_APOLLO,
  3325. 4, CLK_IGNORE_UNUSED, 0),
  3326. GATE(CLK_ACLK_ASATBSLV_APOLLO_0_CSSYS, "aclk_asatbslv_apollo_0_cssys",
  3327. "div_atclk_apollo", ENABLE_ACLK_APOLLO,
  3328. 3, CLK_IGNORE_UNUSED, 0),
  3329. GATE(CLK_ACLK_ASYNCACES_APOLLO_CCI, "aclk_asyncaces_apollo_cci",
  3330. "div_aclk_apollo", ENABLE_ACLK_APOLLO,
  3331. 2, CLK_IGNORE_UNUSED, 0),
  3332. GATE(CLK_ACLK_AHB2APB_APOLLOP, "aclk_ahb2apb_apollop",
  3333. "div_pclk_apollo", ENABLE_ACLK_APOLLO,
  3334. 1, CLK_IGNORE_UNUSED, 0),
  3335. GATE(CLK_ACLK_APOLLONP_200, "aclk_apollonp_200",
  3336. "div_pclk_apollo", ENABLE_ACLK_APOLLO,
  3337. 0, CLK_IGNORE_UNUSED, 0),
  3338. /* ENABLE_PCLK_APOLLO */
  3339. GATE(CLK_PCLK_ASAPBMST_CSSYS_APOLLO, "pclk_asapbmst_cssys_apollo",
  3340. "div_pclk_dbg_apollo", ENABLE_PCLK_APOLLO,
  3341. 2, CLK_IGNORE_UNUSED, 0),
  3342. GATE(CLK_PCLK_PMU_APOLLO, "pclk_pmu_apollo", "div_pclk_apollo",
  3343. ENABLE_PCLK_APOLLO, 1, CLK_IGNORE_UNUSED, 0),
  3344. GATE(CLK_PCLK_SYSREG_APOLLO, "pclk_sysreg_apollo",
  3345. "div_pclk_apollo", ENABLE_PCLK_APOLLO,
  3346. 0, CLK_IGNORE_UNUSED, 0),
  3347. /* ENABLE_SCLK_APOLLO */
  3348. GATE(CLK_CNTCLK_APOLLO, "cntclk_apollo", "div_cntclk_apollo",
  3349. ENABLE_SCLK_APOLLO, 3, CLK_IGNORE_UNUSED, 0),
  3350. GATE(CLK_SCLK_HPM_APOLLO, "sclk_hpm_apollo", "div_sclk_hpm_apollo",
  3351. ENABLE_SCLK_APOLLO, 1, CLK_IGNORE_UNUSED, 0),
  3352. };
  3353. #define E5433_APOLLO_DIV0(cntclk, pclk_dbg, atclk, pclk, aclk) \
  3354. (((cntclk) << 24) | ((pclk_dbg) << 20) | ((atclk) << 16) | \
  3355. ((pclk) << 12) | ((aclk) << 8))
  3356. #define E5433_APOLLO_DIV1(hpm, copy) \
  3357. (((hpm) << 4) | ((copy) << 0))
  3358. static const struct exynos_cpuclk_cfg_data exynos5433_apolloclk_d[] __initconst = {
  3359. { 1300000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
  3360. { 1200000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
  3361. { 1100000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
  3362. { 1000000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
  3363. { 900000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
  3364. { 800000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
  3365. { 700000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
  3366. { 600000, E5433_APOLLO_DIV0(3, 7, 7, 7, 1), E5433_APOLLO_DIV1(7, 1), },
  3367. { 500000, E5433_APOLLO_DIV0(3, 7, 7, 7, 1), E5433_APOLLO_DIV1(7, 1), },
  3368. { 400000, E5433_APOLLO_DIV0(3, 7, 7, 7, 1), E5433_APOLLO_DIV1(7, 1), },
  3369. { 0 },
  3370. };
  3371. static void __init exynos5433_cmu_apollo_init(struct device_node *np)
  3372. {
  3373. void __iomem *reg_base;
  3374. struct samsung_clk_provider *ctx;
  3375. reg_base = of_iomap(np, 0);
  3376. if (!reg_base) {
  3377. panic("%s: failed to map registers\n", __func__);
  3378. return;
  3379. }
  3380. ctx = samsung_clk_init(np, reg_base, APOLLO_NR_CLK);
  3381. if (!ctx) {
  3382. panic("%s: unable to allocate ctx\n", __func__);
  3383. return;
  3384. }
  3385. samsung_clk_register_pll(ctx, apollo_pll_clks,
  3386. ARRAY_SIZE(apollo_pll_clks), reg_base);
  3387. samsung_clk_register_mux(ctx, apollo_mux_clks,
  3388. ARRAY_SIZE(apollo_mux_clks));
  3389. samsung_clk_register_div(ctx, apollo_div_clks,
  3390. ARRAY_SIZE(apollo_div_clks));
  3391. samsung_clk_register_gate(ctx, apollo_gate_clks,
  3392. ARRAY_SIZE(apollo_gate_clks));
  3393. exynos_register_cpu_clock(ctx, CLK_SCLK_APOLLO, "apolloclk",
  3394. mout_apollo_p[0], mout_apollo_p[1], 0x200,
  3395. exynos5433_apolloclk_d, ARRAY_SIZE(exynos5433_apolloclk_d),
  3396. CLK_CPU_HAS_E5433_REGS_LAYOUT);
  3397. samsung_clk_sleep_init(reg_base, apollo_clk_regs,
  3398. ARRAY_SIZE(apollo_clk_regs));
  3399. samsung_clk_of_add_provider(np, ctx);
  3400. }
  3401. CLK_OF_DECLARE(exynos5433_cmu_apollo, "samsung,exynos5433-cmu-apollo",
  3402. exynos5433_cmu_apollo_init);
  3403. /*
  3404. * Register offset definitions for CMU_ATLAS
  3405. */
  3406. #define ATLAS_PLL_LOCK 0x0000
  3407. #define ATLAS_PLL_CON0 0x0100
  3408. #define ATLAS_PLL_CON1 0x0104
  3409. #define ATLAS_PLL_FREQ_DET 0x010c
  3410. #define MUX_SEL_ATLAS0 0x0200
  3411. #define MUX_SEL_ATLAS1 0x0204
  3412. #define MUX_SEL_ATLAS2 0x0208
  3413. #define MUX_ENABLE_ATLAS0 0x0300
  3414. #define MUX_ENABLE_ATLAS1 0x0304
  3415. #define MUX_ENABLE_ATLAS2 0x0308
  3416. #define MUX_STAT_ATLAS0 0x0400
  3417. #define MUX_STAT_ATLAS1 0x0404
  3418. #define MUX_STAT_ATLAS2 0x0408
  3419. #define DIV_ATLAS0 0x0600
  3420. #define DIV_ATLAS1 0x0604
  3421. #define DIV_ATLAS_PLL_FREQ_DET 0x0608
  3422. #define DIV_STAT_ATLAS0 0x0700
  3423. #define DIV_STAT_ATLAS1 0x0704
  3424. #define DIV_STAT_ATLAS_PLL_FREQ_DET 0x0708
  3425. #define ENABLE_ACLK_ATLAS 0x0800
  3426. #define ENABLE_PCLK_ATLAS 0x0900
  3427. #define ENABLE_SCLK_ATLAS 0x0a00
  3428. #define ENABLE_IP_ATLAS0 0x0b00
  3429. #define ENABLE_IP_ATLAS1 0x0b04
  3430. #define CLKOUT_CMU_ATLAS 0x0c00
  3431. #define CLKOUT_CMU_ATLAS_DIV_STAT 0x0c04
  3432. #define ARMCLK_STOPCTRL 0x1000
  3433. #define ATLAS_PWR_CTRL 0x1020
  3434. #define ATLAS_PWR_CTRL2 0x1024
  3435. #define ATLAS_INTR_SPREAD_ENABLE 0x1080
  3436. #define ATLAS_INTR_SPREAD_USE_STANDBYWFI 0x1084
  3437. #define ATLAS_INTR_SPREAD_BLOCKING_DURATION 0x1088
  3438. static const unsigned long atlas_clk_regs[] __initconst = {
  3439. ATLAS_PLL_LOCK,
  3440. ATLAS_PLL_CON0,
  3441. ATLAS_PLL_CON1,
  3442. ATLAS_PLL_FREQ_DET,
  3443. MUX_SEL_ATLAS0,
  3444. MUX_SEL_ATLAS1,
  3445. MUX_SEL_ATLAS2,
  3446. MUX_ENABLE_ATLAS0,
  3447. MUX_ENABLE_ATLAS1,
  3448. MUX_ENABLE_ATLAS2,
  3449. DIV_ATLAS0,
  3450. DIV_ATLAS1,
  3451. DIV_ATLAS_PLL_FREQ_DET,
  3452. ENABLE_ACLK_ATLAS,
  3453. ENABLE_PCLK_ATLAS,
  3454. ENABLE_SCLK_ATLAS,
  3455. ENABLE_IP_ATLAS0,
  3456. ENABLE_IP_ATLAS1,
  3457. CLKOUT_CMU_ATLAS,
  3458. CLKOUT_CMU_ATLAS_DIV_STAT,
  3459. ARMCLK_STOPCTRL,
  3460. ATLAS_PWR_CTRL,
  3461. ATLAS_PWR_CTRL2,
  3462. ATLAS_INTR_SPREAD_ENABLE,
  3463. ATLAS_INTR_SPREAD_USE_STANDBYWFI,
  3464. ATLAS_INTR_SPREAD_BLOCKING_DURATION,
  3465. };
  3466. /* list of all parent clock list */
  3467. PNAME(mout_atlas_pll_p) = { "oscclk", "fout_atlas_pll", };
  3468. PNAME(mout_bus_pll_atlas_user_p) = { "oscclk", "sclk_bus_pll_atlas", };
  3469. PNAME(mout_atlas_p) = { "mout_atlas_pll",
  3470. "mout_bus_pll_atlas_user", };
  3471. static const struct samsung_pll_clock atlas_pll_clks[] __initconst = {
  3472. PLL(pll_35xx, CLK_FOUT_ATLAS_PLL, "fout_atlas_pll", "oscclk",
  3473. ATLAS_PLL_LOCK, ATLAS_PLL_CON0, exynos5433_pll_rates),
  3474. };
  3475. static const struct samsung_mux_clock atlas_mux_clks[] __initconst = {
  3476. /* MUX_SEL_ATLAS0 */
  3477. MUX_F(CLK_MOUT_ATLAS_PLL, "mout_atlas_pll", mout_atlas_pll_p,
  3478. MUX_SEL_ATLAS0, 0, 1, CLK_SET_RATE_PARENT |
  3479. CLK_RECALC_NEW_RATES, 0),
  3480. /* MUX_SEL_ATLAS1 */
  3481. MUX(CLK_MOUT_BUS_PLL_ATLAS_USER, "mout_bus_pll_atlas_user",
  3482. mout_bus_pll_atlas_user_p, MUX_SEL_ATLAS1, 0, 1),
  3483. /* MUX_SEL_ATLAS2 */
  3484. MUX_F(CLK_MOUT_ATLAS, "mout_atlas", mout_atlas_p, MUX_SEL_ATLAS2,
  3485. 0, 1, CLK_SET_RATE_PARENT, 0),
  3486. };
  3487. static const struct samsung_div_clock atlas_div_clks[] __initconst = {
  3488. /* DIV_ATLAS0 */
  3489. DIV_F(CLK_DIV_CNTCLK_ATLAS, "div_cntclk_atlas", "div_atlas2",
  3490. DIV_ATLAS0, 24, 3, CLK_GET_RATE_NOCACHE,
  3491. CLK_DIVIDER_READ_ONLY),
  3492. DIV_F(CLK_DIV_PCLK_DBG_ATLAS, "div_pclk_dbg_atlas", "div_atclk_atlas",
  3493. DIV_ATLAS0, 20, 3, CLK_GET_RATE_NOCACHE,
  3494. CLK_DIVIDER_READ_ONLY),
  3495. DIV_F(CLK_DIV_ATCLK_ATLASO, "div_atclk_atlas", "div_atlas2",
  3496. DIV_ATLAS0, 16, 3, CLK_GET_RATE_NOCACHE,
  3497. CLK_DIVIDER_READ_ONLY),
  3498. DIV_F(CLK_DIV_PCLK_ATLAS, "div_pclk_atlas", "div_atlas2",
  3499. DIV_ATLAS0, 12, 3, CLK_GET_RATE_NOCACHE,
  3500. CLK_DIVIDER_READ_ONLY),
  3501. DIV_F(CLK_DIV_ACLK_ATLAS, "div_aclk_atlas", "div_atlas2",
  3502. DIV_ATLAS0, 8, 3, CLK_GET_RATE_NOCACHE,
  3503. CLK_DIVIDER_READ_ONLY),
  3504. DIV_F(CLK_DIV_ATLAS2, "div_atlas2", "div_atlas1",
  3505. DIV_ATLAS0, 4, 3, CLK_SET_RATE_PARENT, 0),
  3506. DIV_F(CLK_DIV_ATLAS1, "div_atlas1", "mout_atlas",
  3507. DIV_ATLAS0, 0, 3, CLK_SET_RATE_PARENT, 0),
  3508. /* DIV_ATLAS1 */
  3509. DIV_F(CLK_DIV_SCLK_HPM_ATLAS, "div_sclk_hpm_atlas", "mout_atlas",
  3510. DIV_ATLAS1, 4, 3, CLK_GET_RATE_NOCACHE,
  3511. CLK_DIVIDER_READ_ONLY),
  3512. DIV_F(CLK_DIV_ATLAS_PLL, "div_atlas_pll", "mout_atlas",
  3513. DIV_ATLAS1, 0, 3, CLK_GET_RATE_NOCACHE,
  3514. CLK_DIVIDER_READ_ONLY),
  3515. };
  3516. static const struct samsung_gate_clock atlas_gate_clks[] __initconst = {
  3517. /* ENABLE_ACLK_ATLAS */
  3518. GATE(CLK_ACLK_ATB_AUD_CSSYS, "aclk_atb_aud_cssys",
  3519. "div_atclk_atlas", ENABLE_ACLK_ATLAS,
  3520. 9, CLK_IGNORE_UNUSED, 0),
  3521. GATE(CLK_ACLK_ATB_APOLLO3_CSSYS, "aclk_atb_apollo3_cssys",
  3522. "div_atclk_atlas", ENABLE_ACLK_ATLAS,
  3523. 8, CLK_IGNORE_UNUSED, 0),
  3524. GATE(CLK_ACLK_ATB_APOLLO2_CSSYS, "aclk_atb_apollo2_cssys",
  3525. "div_atclk_atlas", ENABLE_ACLK_ATLAS,
  3526. 7, CLK_IGNORE_UNUSED, 0),
  3527. GATE(CLK_ACLK_ATB_APOLLO1_CSSYS, "aclk_atb_apollo1_cssys",
  3528. "div_atclk_atlas", ENABLE_ACLK_ATLAS,
  3529. 6, CLK_IGNORE_UNUSED, 0),
  3530. GATE(CLK_ACLK_ATB_APOLLO0_CSSYS, "aclk_atb_apollo0_cssys",
  3531. "div_atclk_atlas", ENABLE_ACLK_ATLAS,
  3532. 5, CLK_IGNORE_UNUSED, 0),
  3533. GATE(CLK_ACLK_ASYNCAHBS_CSSYS_SSS, "aclk_asyncahbs_cssys_sss",
  3534. "div_atclk_atlas", ENABLE_ACLK_ATLAS,
  3535. 4, CLK_IGNORE_UNUSED, 0),
  3536. GATE(CLK_ACLK_ASYNCAXIS_CSSYS_CCIX, "aclk_asyncaxis_cssys_ccix",
  3537. "div_pclk_dbg_atlas", ENABLE_ACLK_ATLAS,
  3538. 3, CLK_IGNORE_UNUSED, 0),
  3539. GATE(CLK_ACLK_ASYNCACES_ATLAS_CCI, "aclk_asyncaces_atlas_cci",
  3540. "div_aclk_atlas", ENABLE_ACLK_ATLAS,
  3541. 2, CLK_IGNORE_UNUSED, 0),
  3542. GATE(CLK_ACLK_AHB2APB_ATLASP, "aclk_ahb2apb_atlasp", "div_pclk_atlas",
  3543. ENABLE_ACLK_ATLAS, 1, CLK_IGNORE_UNUSED, 0),
  3544. GATE(CLK_ACLK_ATLASNP_200, "aclk_atlasnp_200", "div_pclk_atlas",
  3545. ENABLE_ACLK_ATLAS, 0, CLK_IGNORE_UNUSED, 0),
  3546. /* ENABLE_PCLK_ATLAS */
  3547. GATE(CLK_PCLK_ASYNCAPB_AUD_CSSYS, "pclk_asyncapb_aud_cssys",
  3548. "div_pclk_dbg_atlas", ENABLE_PCLK_ATLAS,
  3549. 5, CLK_IGNORE_UNUSED, 0),
  3550. GATE(CLK_PCLK_ASYNCAPB_ISP_CSSYS, "pclk_asyncapb_isp_cssys",
  3551. "div_pclk_dbg_atlas", ENABLE_PCLK_ATLAS,
  3552. 4, CLK_IGNORE_UNUSED, 0),
  3553. GATE(CLK_PCLK_ASYNCAPB_APOLLO_CSSYS, "pclk_asyncapb_apollo_cssys",
  3554. "div_pclk_dbg_atlas", ENABLE_PCLK_ATLAS,
  3555. 3, CLK_IGNORE_UNUSED, 0),
  3556. GATE(CLK_PCLK_PMU_ATLAS, "pclk_pmu_atlas", "div_pclk_atlas",
  3557. ENABLE_PCLK_ATLAS, 2, CLK_IGNORE_UNUSED, 0),
  3558. GATE(CLK_PCLK_SYSREG_ATLAS, "pclk_sysreg_atlas", "div_pclk_atlas",
  3559. ENABLE_PCLK_ATLAS, 1, CLK_IGNORE_UNUSED, 0),
  3560. GATE(CLK_PCLK_SECJTAG, "pclk_secjtag", "div_pclk_dbg_atlas",
  3561. ENABLE_PCLK_ATLAS, 0, CLK_IGNORE_UNUSED, 0),
  3562. /* ENABLE_SCLK_ATLAS */
  3563. GATE(CLK_CNTCLK_ATLAS, "cntclk_atlas", "div_cntclk_atlas",
  3564. ENABLE_SCLK_ATLAS, 10, CLK_IGNORE_UNUSED, 0),
  3565. GATE(CLK_SCLK_HPM_ATLAS, "sclk_hpm_atlas", "div_sclk_hpm_atlas",
  3566. ENABLE_SCLK_ATLAS, 7, CLK_IGNORE_UNUSED, 0),
  3567. GATE(CLK_TRACECLK, "traceclk", "div_atclk_atlas",
  3568. ENABLE_SCLK_ATLAS, 6, CLK_IGNORE_UNUSED, 0),
  3569. GATE(CLK_CTMCLK, "ctmclk", "div_atclk_atlas",
  3570. ENABLE_SCLK_ATLAS, 5, CLK_IGNORE_UNUSED, 0),
  3571. GATE(CLK_HCLK_CSSYS, "hclk_cssys", "div_atclk_atlas",
  3572. ENABLE_SCLK_ATLAS, 4, CLK_IGNORE_UNUSED, 0),
  3573. GATE(CLK_PCLK_DBG_CSSYS, "pclk_dbg_cssys", "div_pclk_dbg_atlas",
  3574. ENABLE_SCLK_ATLAS, 3, CLK_IGNORE_UNUSED, 0),
  3575. GATE(CLK_PCLK_DBG, "pclk_dbg", "div_pclk_dbg_atlas",
  3576. ENABLE_SCLK_ATLAS, 2, CLK_IGNORE_UNUSED, 0),
  3577. GATE(CLK_ATCLK, "atclk", "div_atclk_atlas",
  3578. ENABLE_SCLK_ATLAS, 1, CLK_IGNORE_UNUSED, 0),
  3579. };
  3580. #define E5433_ATLAS_DIV0(cntclk, pclk_dbg, atclk, pclk, aclk) \
  3581. (((cntclk) << 24) | ((pclk_dbg) << 20) | ((atclk) << 16) | \
  3582. ((pclk) << 12) | ((aclk) << 8))
  3583. #define E5433_ATLAS_DIV1(hpm, copy) \
  3584. (((hpm) << 4) | ((copy) << 0))
  3585. static const struct exynos_cpuclk_cfg_data exynos5433_atlasclk_d[] __initconst = {
  3586. { 1900000, E5433_ATLAS_DIV0(7, 7, 7, 7, 4), E5433_ATLAS_DIV1(7, 1), },
  3587. { 1800000, E5433_ATLAS_DIV0(7, 7, 7, 7, 4), E5433_ATLAS_DIV1(7, 1), },
  3588. { 1700000, E5433_ATLAS_DIV0(7, 7, 7, 7, 4), E5433_ATLAS_DIV1(7, 1), },
  3589. { 1600000, E5433_ATLAS_DIV0(7, 7, 7, 7, 4), E5433_ATLAS_DIV1(7, 1), },
  3590. { 1500000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
  3591. { 1400000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
  3592. { 1300000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
  3593. { 1200000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
  3594. { 1100000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
  3595. { 1000000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
  3596. { 900000, E5433_ATLAS_DIV0(7, 7, 7, 7, 2), E5433_ATLAS_DIV1(7, 1), },
  3597. { 800000, E5433_ATLAS_DIV0(7, 7, 7, 7, 2), E5433_ATLAS_DIV1(7, 1), },
  3598. { 700000, E5433_ATLAS_DIV0(7, 7, 7, 7, 2), E5433_ATLAS_DIV1(7, 1), },
  3599. { 600000, E5433_ATLAS_DIV0(7, 7, 7, 7, 2), E5433_ATLAS_DIV1(7, 1), },
  3600. { 500000, E5433_ATLAS_DIV0(7, 7, 7, 7, 2), E5433_ATLAS_DIV1(7, 1), },
  3601. { 0 },
  3602. };
  3603. static void __init exynos5433_cmu_atlas_init(struct device_node *np)
  3604. {
  3605. void __iomem *reg_base;
  3606. struct samsung_clk_provider *ctx;
  3607. reg_base = of_iomap(np, 0);
  3608. if (!reg_base) {
  3609. panic("%s: failed to map registers\n", __func__);
  3610. return;
  3611. }
  3612. ctx = samsung_clk_init(np, reg_base, ATLAS_NR_CLK);
  3613. if (!ctx) {
  3614. panic("%s: unable to allocate ctx\n", __func__);
  3615. return;
  3616. }
  3617. samsung_clk_register_pll(ctx, atlas_pll_clks,
  3618. ARRAY_SIZE(atlas_pll_clks), reg_base);
  3619. samsung_clk_register_mux(ctx, atlas_mux_clks,
  3620. ARRAY_SIZE(atlas_mux_clks));
  3621. samsung_clk_register_div(ctx, atlas_div_clks,
  3622. ARRAY_SIZE(atlas_div_clks));
  3623. samsung_clk_register_gate(ctx, atlas_gate_clks,
  3624. ARRAY_SIZE(atlas_gate_clks));
  3625. exynos_register_cpu_clock(ctx, CLK_SCLK_ATLAS, "atlasclk",
  3626. mout_atlas_p[0], mout_atlas_p[1], 0x200,
  3627. exynos5433_atlasclk_d, ARRAY_SIZE(exynos5433_atlasclk_d),
  3628. CLK_CPU_HAS_E5433_REGS_LAYOUT);
  3629. samsung_clk_sleep_init(reg_base, atlas_clk_regs,
  3630. ARRAY_SIZE(atlas_clk_regs));
  3631. samsung_clk_of_add_provider(np, ctx);
  3632. }
  3633. CLK_OF_DECLARE(exynos5433_cmu_atlas, "samsung,exynos5433-cmu-atlas",
  3634. exynos5433_cmu_atlas_init);
  3635. /*
  3636. * Register offset definitions for CMU_MSCL
  3637. */
  3638. #define MUX_SEL_MSCL0 0x0200
  3639. #define MUX_SEL_MSCL1 0x0204
  3640. #define MUX_ENABLE_MSCL0 0x0300
  3641. #define MUX_ENABLE_MSCL1 0x0304
  3642. #define MUX_STAT_MSCL0 0x0400
  3643. #define MUX_STAT_MSCL1 0x0404
  3644. #define DIV_MSCL 0x0600
  3645. #define DIV_STAT_MSCL 0x0700
  3646. #define ENABLE_ACLK_MSCL 0x0800
  3647. #define ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER0 0x0804
  3648. #define ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER1 0x0808
  3649. #define ENABLE_ACLK_MSCL_SECURE_SMMU_JPEG 0x080c
  3650. #define ENABLE_PCLK_MSCL 0x0900
  3651. #define ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER0 0x0904
  3652. #define ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER1 0x0908
  3653. #define ENABLE_PCLK_MSCL_SECURE_SMMU_JPEG 0x090c
  3654. #define ENABLE_SCLK_MSCL 0x0a00
  3655. #define ENABLE_IP_MSCL0 0x0b00
  3656. #define ENABLE_IP_MSCL1 0x0b04
  3657. #define ENABLE_IP_MSCL_SECURE_SMMU_M2MSCALER0 0x0b08
  3658. #define ENABLE_IP_MSCL_SECURE_SMMU_M2MSCALER1 0x0b0c
  3659. #define ENABLE_IP_MSCL_SECURE_SMMU_JPEG 0x0b10
  3660. static const unsigned long mscl_clk_regs[] __initconst = {
  3661. MUX_SEL_MSCL0,
  3662. MUX_SEL_MSCL1,
  3663. MUX_ENABLE_MSCL0,
  3664. MUX_ENABLE_MSCL1,
  3665. DIV_MSCL,
  3666. ENABLE_ACLK_MSCL,
  3667. ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER0,
  3668. ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER1,
  3669. ENABLE_ACLK_MSCL_SECURE_SMMU_JPEG,
  3670. ENABLE_PCLK_MSCL,
  3671. ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER0,
  3672. ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER1,
  3673. ENABLE_PCLK_MSCL_SECURE_SMMU_JPEG,
  3674. ENABLE_SCLK_MSCL,
  3675. ENABLE_IP_MSCL0,
  3676. ENABLE_IP_MSCL1,
  3677. ENABLE_IP_MSCL_SECURE_SMMU_M2MSCALER0,
  3678. ENABLE_IP_MSCL_SECURE_SMMU_M2MSCALER1,
  3679. ENABLE_IP_MSCL_SECURE_SMMU_JPEG,
  3680. };
  3681. /* list of all parent clock list */
  3682. PNAME(mout_sclk_jpeg_user_p) = { "oscclk", "sclk_jpeg_mscl", };
  3683. PNAME(mout_aclk_mscl_400_user_p) = { "oscclk", "aclk_mscl_400", };
  3684. PNAME(mout_sclk_jpeg_p) = { "mout_sclk_jpeg_user",
  3685. "mout_aclk_mscl_400_user", };
  3686. static const struct samsung_mux_clock mscl_mux_clks[] __initconst = {
  3687. /* MUX_SEL_MSCL0 */
  3688. MUX(CLK_MOUT_SCLK_JPEG_USER, "mout_sclk_jpeg_user",
  3689. mout_sclk_jpeg_user_p, MUX_SEL_MSCL0, 4, 1),
  3690. MUX(CLK_MOUT_ACLK_MSCL_400_USER, "mout_aclk_mscl_400_user",
  3691. mout_aclk_mscl_400_user_p, MUX_SEL_MSCL0, 0, 1),
  3692. /* MUX_SEL_MSCL1 */
  3693. MUX(CLK_MOUT_SCLK_JPEG, "mout_sclk_jpeg", mout_sclk_jpeg_p,
  3694. MUX_SEL_MSCL1, 0, 1),
  3695. };
  3696. static const struct samsung_div_clock mscl_div_clks[] __initconst = {
  3697. /* DIV_MSCL */
  3698. DIV(CLK_DIV_PCLK_MSCL, "div_pclk_mscl", "mout_aclk_mscl_400_user",
  3699. DIV_MSCL, 0, 3),
  3700. };
  3701. static const struct samsung_gate_clock mscl_gate_clks[] __initconst = {
  3702. /* ENABLE_ACLK_MSCL */
  3703. GATE(CLK_ACLK_BTS_JPEG, "aclk_bts_jpeg", "mout_aclk_mscl_400_user",
  3704. ENABLE_ACLK_MSCL, 9, 0, 0),
  3705. GATE(CLK_ACLK_BTS_M2MSCALER1, "aclk_bts_m2mscaler1",
  3706. "mout_aclk_mscl_400_user", ENABLE_ACLK_MSCL, 8, 0, 0),
  3707. GATE(CLK_ACLK_BTS_M2MSCALER0, "aclk_bts_m2mscaler0",
  3708. "mout_aclk_mscl_400_user", ENABLE_ACLK_MSCL, 7, 0, 0),
  3709. GATE(CLK_ACLK_AHB2APB_MSCL0P, "aclk_abh2apb_mscl0p", "div_pclk_mscl",
  3710. ENABLE_ACLK_MSCL, 6, CLK_IGNORE_UNUSED, 0),
  3711. GATE(CLK_ACLK_XIU_MSCLX, "aclk_xiu_msclx", "mout_aclk_mscl_400_user",
  3712. ENABLE_ACLK_MSCL, 5, CLK_IGNORE_UNUSED, 0),
  3713. GATE(CLK_ACLK_MSCLNP_100, "aclk_msclnp_100", "div_pclk_mscl",
  3714. ENABLE_ACLK_MSCL, 4, CLK_IGNORE_UNUSED, 0),
  3715. GATE(CLK_ACLK_MSCLND_400, "aclk_msclnd_400", "mout_aclk_mscl_400_user",
  3716. ENABLE_ACLK_MSCL, 3, CLK_IGNORE_UNUSED, 0),
  3717. GATE(CLK_ACLK_JPEG, "aclk_jpeg", "mout_aclk_mscl_400_user",
  3718. ENABLE_ACLK_MSCL, 2, 0, 0),
  3719. GATE(CLK_ACLK_M2MSCALER1, "aclk_m2mscaler1", "mout_aclk_mscl_400_user",
  3720. ENABLE_ACLK_MSCL, 1, 0, 0),
  3721. GATE(CLK_ACLK_M2MSCALER0, "aclk_m2mscaler0", "mout_aclk_mscl_400_user",
  3722. ENABLE_ACLK_MSCL, 0, 0, 0),
  3723. /* ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER0 */
  3724. GATE(CLK_ACLK_SMMU_M2MSCALER0, "aclk_smmu_m2mscaler0",
  3725. "mout_aclk_mscl_400_user",
  3726. ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER0,
  3727. 0, CLK_IGNORE_UNUSED, 0),
  3728. /* ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER1 */
  3729. GATE(CLK_ACLK_SMMU_M2MSCALER1, "aclk_smmu_m2mscaler1",
  3730. "mout_aclk_mscl_400_user",
  3731. ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER1,
  3732. 0, CLK_IGNORE_UNUSED, 0),
  3733. /* ENABLE_ACLK_MSCL_SECURE_SMMU_JPEG */
  3734. GATE(CLK_ACLK_SMMU_JPEG, "aclk_smmu_jpeg", "mout_aclk_mscl_400_user",
  3735. ENABLE_ACLK_MSCL_SECURE_SMMU_JPEG,
  3736. 0, CLK_IGNORE_UNUSED, 0),
  3737. /* ENABLE_PCLK_MSCL */
  3738. GATE(CLK_PCLK_BTS_JPEG, "pclk_bts_jpeg", "div_pclk_mscl",
  3739. ENABLE_PCLK_MSCL, 7, 0, 0),
  3740. GATE(CLK_PCLK_BTS_M2MSCALER1, "pclk_bts_m2mscaler1", "div_pclk_mscl",
  3741. ENABLE_PCLK_MSCL, 6, 0, 0),
  3742. GATE(CLK_PCLK_BTS_M2MSCALER0, "pclk_bts_m2mscaler0", "div_pclk_mscl",
  3743. ENABLE_PCLK_MSCL, 5, 0, 0),
  3744. GATE(CLK_PCLK_PMU_MSCL, "pclk_pmu_mscl", "div_pclk_mscl",
  3745. ENABLE_PCLK_MSCL, 4, CLK_IGNORE_UNUSED, 0),
  3746. GATE(CLK_PCLK_SYSREG_MSCL, "pclk_sysreg_mscl", "div_pclk_mscl",
  3747. ENABLE_PCLK_MSCL, 3, CLK_IGNORE_UNUSED, 0),
  3748. GATE(CLK_PCLK_JPEG, "pclk_jpeg", "div_pclk_mscl",
  3749. ENABLE_PCLK_MSCL, 2, 0, 0),
  3750. GATE(CLK_PCLK_M2MSCALER1, "pclk_m2mscaler1", "div_pclk_mscl",
  3751. ENABLE_PCLK_MSCL, 1, 0, 0),
  3752. GATE(CLK_PCLK_M2MSCALER0, "pclk_m2mscaler0", "div_pclk_mscl",
  3753. ENABLE_PCLK_MSCL, 0, 0, 0),
  3754. /* ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER0 */
  3755. GATE(CLK_PCLK_SMMU_M2MSCALER0, "pclk_smmu_m2mscaler0", "div_pclk_mscl",
  3756. ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER0,
  3757. 0, CLK_IGNORE_UNUSED, 0),
  3758. /* ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER1 */
  3759. GATE(CLK_PCLK_SMMU_M2MSCALER1, "pclk_smmu_m2mscaler1", "div_pclk_mscl",
  3760. ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER1,
  3761. 0, CLK_IGNORE_UNUSED, 0),
  3762. /* ENABLE_PCLK_MSCL_SECURE_SMMU_JPEG */
  3763. GATE(CLK_PCLK_SMMU_JPEG, "pclk_smmu_jpeg", "div_pclk_mscl",
  3764. ENABLE_PCLK_MSCL_SECURE_SMMU_JPEG,
  3765. 0, CLK_IGNORE_UNUSED, 0),
  3766. /* ENABLE_SCLK_MSCL */
  3767. GATE(CLK_SCLK_JPEG, "sclk_jpeg", "mout_sclk_jpeg", ENABLE_SCLK_MSCL, 0,
  3768. CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
  3769. };
  3770. static const struct samsung_cmu_info mscl_cmu_info __initconst = {
  3771. .mux_clks = mscl_mux_clks,
  3772. .nr_mux_clks = ARRAY_SIZE(mscl_mux_clks),
  3773. .div_clks = mscl_div_clks,
  3774. .nr_div_clks = ARRAY_SIZE(mscl_div_clks),
  3775. .gate_clks = mscl_gate_clks,
  3776. .nr_gate_clks = ARRAY_SIZE(mscl_gate_clks),
  3777. .nr_clk_ids = MSCL_NR_CLK,
  3778. .clk_regs = mscl_clk_regs,
  3779. .nr_clk_regs = ARRAY_SIZE(mscl_clk_regs),
  3780. };
  3781. static void __init exynos5433_cmu_mscl_init(struct device_node *np)
  3782. {
  3783. samsung_cmu_register_one(np, &mscl_cmu_info);
  3784. }
  3785. CLK_OF_DECLARE(exynos5433_cmu_mscl, "samsung,exynos5433-cmu-mscl",
  3786. exynos5433_cmu_mscl_init);
  3787. /*
  3788. * Register offset definitions for CMU_MFC
  3789. */
  3790. #define MUX_SEL_MFC 0x0200
  3791. #define MUX_ENABLE_MFC 0x0300
  3792. #define MUX_STAT_MFC 0x0400
  3793. #define DIV_MFC 0x0600
  3794. #define DIV_STAT_MFC 0x0700
  3795. #define ENABLE_ACLK_MFC 0x0800
  3796. #define ENABLE_ACLK_MFC_SECURE_SMMU_MFC 0x0804
  3797. #define ENABLE_PCLK_MFC 0x0900
  3798. #define ENABLE_PCLK_MFC_SECURE_SMMU_MFC 0x0904
  3799. #define ENABLE_IP_MFC0 0x0b00
  3800. #define ENABLE_IP_MFC1 0x0b04
  3801. #define ENABLE_IP_MFC_SECURE_SMMU_MFC 0x0b08
  3802. static const unsigned long mfc_clk_regs[] __initconst = {
  3803. MUX_SEL_MFC,
  3804. MUX_ENABLE_MFC,
  3805. DIV_MFC,
  3806. ENABLE_ACLK_MFC,
  3807. ENABLE_ACLK_MFC_SECURE_SMMU_MFC,
  3808. ENABLE_PCLK_MFC,
  3809. ENABLE_PCLK_MFC_SECURE_SMMU_MFC,
  3810. ENABLE_IP_MFC0,
  3811. ENABLE_IP_MFC1,
  3812. ENABLE_IP_MFC_SECURE_SMMU_MFC,
  3813. };
  3814. PNAME(mout_aclk_mfc_400_user_p) = { "oscclk", "aclk_mfc_400", };
  3815. static const struct samsung_mux_clock mfc_mux_clks[] __initconst = {
  3816. /* MUX_SEL_MFC */
  3817. MUX(CLK_MOUT_ACLK_MFC_400_USER, "mout_aclk_mfc_400_user",
  3818. mout_aclk_mfc_400_user_p, MUX_SEL_MFC, 0, 0),
  3819. };
  3820. static const struct samsung_div_clock mfc_div_clks[] __initconst = {
  3821. /* DIV_MFC */
  3822. DIV(CLK_DIV_PCLK_MFC, "div_pclk_mfc", "mout_aclk_mfc_400_user",
  3823. DIV_MFC, 0, 2),
  3824. };
  3825. static const struct samsung_gate_clock mfc_gate_clks[] __initconst = {
  3826. /* ENABLE_ACLK_MFC */
  3827. GATE(CLK_ACLK_BTS_MFC_1, "aclk_bts_mfc_1", "mout_aclk_mfc_400_user",
  3828. ENABLE_ACLK_MFC, 6, 0, 0),
  3829. GATE(CLK_ACLK_BTS_MFC_0, "aclk_bts_mfc_0", "mout_aclk_mfc_400_user",
  3830. ENABLE_ACLK_MFC, 5, 0, 0),
  3831. GATE(CLK_ACLK_AHB2APB_MFCP, "aclk_ahb2apb_mfcp", "div_pclk_mfc",
  3832. ENABLE_ACLK_MFC, 4, CLK_IGNORE_UNUSED, 0),
  3833. GATE(CLK_ACLK_XIU_MFCX, "aclk_xiu_mfcx", "mout_aclk_mfc_400_user",
  3834. ENABLE_ACLK_MFC, 3, CLK_IGNORE_UNUSED, 0),
  3835. GATE(CLK_ACLK_MFCNP_100, "aclk_mfcnp_100", "div_pclk_mfc",
  3836. ENABLE_ACLK_MFC, 2, CLK_IGNORE_UNUSED, 0),
  3837. GATE(CLK_ACLK_MFCND_400, "aclk_mfcnd_400", "mout_aclk_mfc_400_user",
  3838. ENABLE_ACLK_MFC, 1, CLK_IGNORE_UNUSED, 0),
  3839. GATE(CLK_ACLK_MFC, "aclk_mfc", "mout_aclk_mfc_400_user",
  3840. ENABLE_ACLK_MFC, 0, 0, 0),
  3841. /* ENABLE_ACLK_MFC_SECURE_SMMU_MFC */
  3842. GATE(CLK_ACLK_SMMU_MFC_1, "aclk_smmu_mfc_1", "mout_aclk_mfc_400_user",
  3843. ENABLE_ACLK_MFC_SECURE_SMMU_MFC,
  3844. 1, CLK_IGNORE_UNUSED, 0),
  3845. GATE(CLK_ACLK_SMMU_MFC_0, "aclk_smmu_mfc_0", "mout_aclk_mfc_400_user",
  3846. ENABLE_ACLK_MFC_SECURE_SMMU_MFC,
  3847. 0, CLK_IGNORE_UNUSED, 0),
  3848. /* ENABLE_PCLK_MFC */
  3849. GATE(CLK_PCLK_BTS_MFC_1, "pclk_bts_mfc_1", "div_pclk_mfc",
  3850. ENABLE_PCLK_MFC, 4, 0, 0),
  3851. GATE(CLK_PCLK_BTS_MFC_0, "pclk_bts_mfc_0", "div_pclk_mfc",
  3852. ENABLE_PCLK_MFC, 3, 0, 0),
  3853. GATE(CLK_PCLK_PMU_MFC, "pclk_pmu_mfc", "div_pclk_mfc",
  3854. ENABLE_PCLK_MFC, 2, CLK_IGNORE_UNUSED, 0),
  3855. GATE(CLK_PCLK_SYSREG_MFC, "pclk_sysreg_mfc", "div_pclk_mfc",
  3856. ENABLE_PCLK_MFC, 1, CLK_IGNORE_UNUSED, 0),
  3857. GATE(CLK_PCLK_MFC, "pclk_mfc", "div_pclk_mfc",
  3858. ENABLE_PCLK_MFC, 4, CLK_IGNORE_UNUSED, 0),
  3859. /* ENABLE_PCLK_MFC_SECURE_SMMU_MFC */
  3860. GATE(CLK_PCLK_SMMU_MFC_1, "pclk_smmu_mfc_1", "div_pclk_mfc",
  3861. ENABLE_PCLK_MFC_SECURE_SMMU_MFC,
  3862. 1, CLK_IGNORE_UNUSED, 0),
  3863. GATE(CLK_PCLK_SMMU_MFC_0, "pclk_smmu_mfc_0", "div_pclk_mfc",
  3864. ENABLE_PCLK_MFC_SECURE_SMMU_MFC,
  3865. 0, CLK_IGNORE_UNUSED, 0),
  3866. };
  3867. static const struct samsung_cmu_info mfc_cmu_info __initconst = {
  3868. .mux_clks = mfc_mux_clks,
  3869. .nr_mux_clks = ARRAY_SIZE(mfc_mux_clks),
  3870. .div_clks = mfc_div_clks,
  3871. .nr_div_clks = ARRAY_SIZE(mfc_div_clks),
  3872. .gate_clks = mfc_gate_clks,
  3873. .nr_gate_clks = ARRAY_SIZE(mfc_gate_clks),
  3874. .nr_clk_ids = MFC_NR_CLK,
  3875. .clk_regs = mfc_clk_regs,
  3876. .nr_clk_regs = ARRAY_SIZE(mfc_clk_regs),
  3877. };
  3878. static void __init exynos5433_cmu_mfc_init(struct device_node *np)
  3879. {
  3880. samsung_cmu_register_one(np, &mfc_cmu_info);
  3881. }
  3882. CLK_OF_DECLARE(exynos5433_cmu_mfc, "samsung,exynos5433-cmu-mfc",
  3883. exynos5433_cmu_mfc_init);
  3884. /*
  3885. * Register offset definitions for CMU_HEVC
  3886. */
  3887. #define MUX_SEL_HEVC 0x0200
  3888. #define MUX_ENABLE_HEVC 0x0300
  3889. #define MUX_STAT_HEVC 0x0400
  3890. #define DIV_HEVC 0x0600
  3891. #define DIV_STAT_HEVC 0x0700
  3892. #define ENABLE_ACLK_HEVC 0x0800
  3893. #define ENABLE_ACLK_HEVC_SECURE_SMMU_HEVC 0x0804
  3894. #define ENABLE_PCLK_HEVC 0x0900
  3895. #define ENABLE_PCLK_HEVC_SECURE_SMMU_HEVC 0x0904
  3896. #define ENABLE_IP_HEVC0 0x0b00
  3897. #define ENABLE_IP_HEVC1 0x0b04
  3898. #define ENABLE_IP_HEVC_SECURE_SMMU_HEVC 0x0b08
  3899. static const unsigned long hevc_clk_regs[] __initconst = {
  3900. MUX_SEL_HEVC,
  3901. MUX_ENABLE_HEVC,
  3902. DIV_HEVC,
  3903. ENABLE_ACLK_HEVC,
  3904. ENABLE_ACLK_HEVC_SECURE_SMMU_HEVC,
  3905. ENABLE_PCLK_HEVC,
  3906. ENABLE_PCLK_HEVC_SECURE_SMMU_HEVC,
  3907. ENABLE_IP_HEVC0,
  3908. ENABLE_IP_HEVC1,
  3909. ENABLE_IP_HEVC_SECURE_SMMU_HEVC,
  3910. };
  3911. PNAME(mout_aclk_hevc_400_user_p) = { "oscclk", "aclk_hevc_400", };
  3912. static const struct samsung_mux_clock hevc_mux_clks[] __initconst = {
  3913. /* MUX_SEL_HEVC */
  3914. MUX(CLK_MOUT_ACLK_HEVC_400_USER, "mout_aclk_hevc_400_user",
  3915. mout_aclk_hevc_400_user_p, MUX_SEL_HEVC, 0, 0),
  3916. };
  3917. static const struct samsung_div_clock hevc_div_clks[] __initconst = {
  3918. /* DIV_HEVC */
  3919. DIV(CLK_DIV_PCLK_HEVC, "div_pclk_hevc", "mout_aclk_hevc_400_user",
  3920. DIV_HEVC, 0, 2),
  3921. };
  3922. static const struct samsung_gate_clock hevc_gate_clks[] __initconst = {
  3923. /* ENABLE_ACLK_HEVC */
  3924. GATE(CLK_ACLK_BTS_HEVC_1, "aclk_bts_hevc_1", "mout_aclk_hevc_400_user",
  3925. ENABLE_ACLK_HEVC, 6, 0, 0),
  3926. GATE(CLK_ACLK_BTS_HEVC_0, "aclk_bts_hevc_0", "mout_aclk_hevc_400_user",
  3927. ENABLE_ACLK_HEVC, 5, 0, 0),
  3928. GATE(CLK_ACLK_AHB2APB_HEVCP, "aclk_ahb2apb_hevcp", "div_pclk_hevc",
  3929. ENABLE_ACLK_HEVC, 4, CLK_IGNORE_UNUSED, 0),
  3930. GATE(CLK_ACLK_XIU_HEVCX, "aclk_xiu_hevcx", "mout_aclk_hevc_400_user",
  3931. ENABLE_ACLK_HEVC, 3, CLK_IGNORE_UNUSED, 0),
  3932. GATE(CLK_ACLK_HEVCNP_100, "aclk_hevcnp_100", "div_pclk_hevc",
  3933. ENABLE_ACLK_HEVC, 2, CLK_IGNORE_UNUSED, 0),
  3934. GATE(CLK_ACLK_HEVCND_400, "aclk_hevcnd_400", "mout_aclk_hevc_400_user",
  3935. ENABLE_ACLK_HEVC, 1, CLK_IGNORE_UNUSED, 0),
  3936. GATE(CLK_ACLK_HEVC, "aclk_hevc", "mout_aclk_hevc_400_user",
  3937. ENABLE_ACLK_HEVC, 0, 0, 0),
  3938. /* ENABLE_ACLK_HEVC_SECURE_SMMU_HEVC */
  3939. GATE(CLK_ACLK_SMMU_HEVC_1, "aclk_smmu_hevc_1",
  3940. "mout_aclk_hevc_400_user",
  3941. ENABLE_ACLK_HEVC_SECURE_SMMU_HEVC,
  3942. 1, CLK_IGNORE_UNUSED, 0),
  3943. GATE(CLK_ACLK_SMMU_HEVC_0, "aclk_smmu_hevc_0",
  3944. "mout_aclk_hevc_400_user",
  3945. ENABLE_ACLK_HEVC_SECURE_SMMU_HEVC,
  3946. 0, CLK_IGNORE_UNUSED, 0),
  3947. /* ENABLE_PCLK_HEVC */
  3948. GATE(CLK_PCLK_BTS_HEVC_1, "pclk_bts_hevc_1", "div_pclk_hevc",
  3949. ENABLE_PCLK_HEVC, 4, 0, 0),
  3950. GATE(CLK_PCLK_BTS_HEVC_0, "pclk_bts_hevc_0", "div_pclk_hevc",
  3951. ENABLE_PCLK_HEVC, 3, 0, 0),
  3952. GATE(CLK_PCLK_PMU_HEVC, "pclk_pmu_hevc", "div_pclk_hevc",
  3953. ENABLE_PCLK_HEVC, 2, CLK_IGNORE_UNUSED, 0),
  3954. GATE(CLK_PCLK_SYSREG_HEVC, "pclk_sysreg_hevc", "div_pclk_hevc",
  3955. ENABLE_PCLK_HEVC, 1, CLK_IGNORE_UNUSED, 0),
  3956. GATE(CLK_PCLK_HEVC, "pclk_hevc", "div_pclk_hevc",
  3957. ENABLE_PCLK_HEVC, 4, CLK_IGNORE_UNUSED, 0),
  3958. /* ENABLE_PCLK_HEVC_SECURE_SMMU_HEVC */
  3959. GATE(CLK_PCLK_SMMU_HEVC_1, "pclk_smmu_hevc_1", "div_pclk_hevc",
  3960. ENABLE_PCLK_HEVC_SECURE_SMMU_HEVC,
  3961. 1, CLK_IGNORE_UNUSED, 0),
  3962. GATE(CLK_PCLK_SMMU_HEVC_0, "pclk_smmu_hevc_0", "div_pclk_hevc",
  3963. ENABLE_PCLK_HEVC_SECURE_SMMU_HEVC,
  3964. 0, CLK_IGNORE_UNUSED, 0),
  3965. };
  3966. static const struct samsung_cmu_info hevc_cmu_info __initconst = {
  3967. .mux_clks = hevc_mux_clks,
  3968. .nr_mux_clks = ARRAY_SIZE(hevc_mux_clks),
  3969. .div_clks = hevc_div_clks,
  3970. .nr_div_clks = ARRAY_SIZE(hevc_div_clks),
  3971. .gate_clks = hevc_gate_clks,
  3972. .nr_gate_clks = ARRAY_SIZE(hevc_gate_clks),
  3973. .nr_clk_ids = HEVC_NR_CLK,
  3974. .clk_regs = hevc_clk_regs,
  3975. .nr_clk_regs = ARRAY_SIZE(hevc_clk_regs),
  3976. };
  3977. static void __init exynos5433_cmu_hevc_init(struct device_node *np)
  3978. {
  3979. samsung_cmu_register_one(np, &hevc_cmu_info);
  3980. }
  3981. CLK_OF_DECLARE(exynos5433_cmu_hevc, "samsung,exynos5433-cmu-hevc",
  3982. exynos5433_cmu_hevc_init);
  3983. /*
  3984. * Register offset definitions for CMU_ISP
  3985. */
  3986. #define MUX_SEL_ISP 0x0200
  3987. #define MUX_ENABLE_ISP 0x0300
  3988. #define MUX_STAT_ISP 0x0400
  3989. #define DIV_ISP 0x0600
  3990. #define DIV_STAT_ISP 0x0700
  3991. #define ENABLE_ACLK_ISP0 0x0800
  3992. #define ENABLE_ACLK_ISP1 0x0804
  3993. #define ENABLE_ACLK_ISP2 0x0808
  3994. #define ENABLE_PCLK_ISP 0x0900
  3995. #define ENABLE_SCLK_ISP 0x0a00
  3996. #define ENABLE_IP_ISP0 0x0b00
  3997. #define ENABLE_IP_ISP1 0x0b04
  3998. #define ENABLE_IP_ISP2 0x0b08
  3999. #define ENABLE_IP_ISP3 0x0b0c
  4000. static const unsigned long isp_clk_regs[] __initconst = {
  4001. MUX_SEL_ISP,
  4002. MUX_ENABLE_ISP,
  4003. DIV_ISP,
  4004. ENABLE_ACLK_ISP0,
  4005. ENABLE_ACLK_ISP1,
  4006. ENABLE_ACLK_ISP2,
  4007. ENABLE_PCLK_ISP,
  4008. ENABLE_SCLK_ISP,
  4009. ENABLE_IP_ISP0,
  4010. ENABLE_IP_ISP1,
  4011. ENABLE_IP_ISP2,
  4012. ENABLE_IP_ISP3,
  4013. };
  4014. PNAME(mout_aclk_isp_dis_400_user_p) = { "oscclk", "aclk_isp_dis_400", };
  4015. PNAME(mout_aclk_isp_400_user_p) = { "oscclk", "aclk_isp_400", };
  4016. static const struct samsung_mux_clock isp_mux_clks[] __initconst = {
  4017. /* MUX_SEL_ISP */
  4018. MUX(CLK_MOUT_ACLK_ISP_DIS_400_USER, "mout_aclk_isp_dis_400_user",
  4019. mout_aclk_isp_dis_400_user_p, MUX_SEL_ISP, 4, 0),
  4020. MUX(CLK_MOUT_ACLK_ISP_400_USER, "mout_aclk_isp_400_user",
  4021. mout_aclk_isp_400_user_p, MUX_SEL_ISP, 0, 0),
  4022. };
  4023. static const struct samsung_div_clock isp_div_clks[] __initconst = {
  4024. /* DIV_ISP */
  4025. DIV(CLK_DIV_PCLK_ISP_DIS, "div_pclk_isp_dis",
  4026. "mout_aclk_isp_dis_400_user", DIV_ISP, 12, 3),
  4027. DIV(CLK_DIV_PCLK_ISP, "div_pclk_isp", "mout_aclk_isp_400_user",
  4028. DIV_ISP, 8, 3),
  4029. DIV(CLK_DIV_ACLK_ISP_D_200, "div_aclk_isp_d_200",
  4030. "mout_aclk_isp_400_user", DIV_ISP, 4, 3),
  4031. DIV(CLK_DIV_ACLK_ISP_C_200, "div_aclk_isp_c_200",
  4032. "mout_aclk_isp_400_user", DIV_ISP, 0, 3),
  4033. };
  4034. static const struct samsung_gate_clock isp_gate_clks[] __initconst = {
  4035. /* ENABLE_ACLK_ISP0 */
  4036. GATE(CLK_ACLK_ISP_D_GLUE, "aclk_isp_d_glue", "mout_aclk_isp_400_user",
  4037. ENABLE_ACLK_ISP0, 6, CLK_IGNORE_UNUSED, 0),
  4038. GATE(CLK_ACLK_SCALERP, "aclk_scalerp", "mout_aclk_isp_400_user",
  4039. ENABLE_ACLK_ISP0, 5, 0, 0),
  4040. GATE(CLK_ACLK_3DNR, "aclk_3dnr", "mout_aclk_isp_400_user",
  4041. ENABLE_ACLK_ISP0, 4, 0, 0),
  4042. GATE(CLK_ACLK_DIS, "aclk_dis", "mout_aclk_isp_dis_400_user",
  4043. ENABLE_ACLK_ISP0, 3, 0, 0),
  4044. GATE(CLK_ACLK_SCALERC, "aclk_scalerc", "mout_aclk_isp_400_user",
  4045. ENABLE_ACLK_ISP0, 2, 0, 0),
  4046. GATE(CLK_ACLK_DRC, "aclk_drc", "mout_aclk_isp_400_user",
  4047. ENABLE_ACLK_ISP0, 1, 0, 0),
  4048. GATE(CLK_ACLK_ISP, "aclk_isp", "mout_aclk_isp_400_user",
  4049. ENABLE_ACLK_ISP0, 0, 0, 0),
  4050. /* ENABLE_ACLK_ISP1 */
  4051. GATE(CLK_ACLK_AXIUS_SCALERP, "aclk_axius_scalerp",
  4052. "mout_aclk_isp_400_user", ENABLE_ACLK_ISP1,
  4053. 17, CLK_IGNORE_UNUSED, 0),
  4054. GATE(CLK_ACLK_AXIUS_SCALERC, "aclk_axius_scalerc",
  4055. "mout_aclk_isp_400_user", ENABLE_ACLK_ISP1,
  4056. 16, CLK_IGNORE_UNUSED, 0),
  4057. GATE(CLK_ACLK_AXIUS_DRC, "aclk_axius_drc",
  4058. "mout_aclk_isp_400_user", ENABLE_ACLK_ISP1,
  4059. 15, CLK_IGNORE_UNUSED, 0),
  4060. GATE(CLK_ACLK_ASYNCAHBM_ISP2P, "aclk_asyncahbm_isp2p",
  4061. "div_pclk_isp", ENABLE_ACLK_ISP1,
  4062. 14, CLK_IGNORE_UNUSED, 0),
  4063. GATE(CLK_ACLK_ASYNCAHBM_ISP1P, "aclk_asyncahbm_isp1p",
  4064. "div_pclk_isp", ENABLE_ACLK_ISP1,
  4065. 13, CLK_IGNORE_UNUSED, 0),
  4066. GATE(CLK_ACLK_ASYNCAXIS_DIS1, "aclk_asyncaxis_dis1",
  4067. "mout_aclk_isp_dis_400_user", ENABLE_ACLK_ISP1,
  4068. 12, CLK_IGNORE_UNUSED, 0),
  4069. GATE(CLK_ACLK_ASYNCAXIS_DIS0, "aclk_asyncaxis_dis0",
  4070. "mout_aclk_isp_dis_400_user", ENABLE_ACLK_ISP1,
  4071. 11, CLK_IGNORE_UNUSED, 0),
  4072. GATE(CLK_ACLK_ASYNCAXIM_DIS1, "aclk_asyncaxim_dis1",
  4073. "mout_aclk_isp_400_user", ENABLE_ACLK_ISP1,
  4074. 10, CLK_IGNORE_UNUSED, 0),
  4075. GATE(CLK_ACLK_ASYNCAXIM_DIS0, "aclk_asyncaxim_dis0",
  4076. "mout_aclk_isp_400_user", ENABLE_ACLK_ISP1,
  4077. 9, CLK_IGNORE_UNUSED, 0),
  4078. GATE(CLK_ACLK_ASYNCAXIM_ISP2P, "aclk_asyncaxim_isp2p",
  4079. "div_aclk_isp_d_200", ENABLE_ACLK_ISP1,
  4080. 8, CLK_IGNORE_UNUSED, 0),
  4081. GATE(CLK_ACLK_ASYNCAXIM_ISP1P, "aclk_asyncaxim_isp1p",
  4082. "div_aclk_isp_c_200", ENABLE_ACLK_ISP1,
  4083. 7, CLK_IGNORE_UNUSED, 0),
  4084. GATE(CLK_ACLK_AHB2APB_ISP2P, "aclk_ahb2apb_isp2p", "div_pclk_isp",
  4085. ENABLE_ACLK_ISP1, 6, CLK_IGNORE_UNUSED, 0),
  4086. GATE(CLK_ACLK_AHB2APB_ISP1P, "aclk_ahb2apb_isp1p", "div_pclk_isp",
  4087. ENABLE_ACLK_ISP1, 5, CLK_IGNORE_UNUSED, 0),
  4088. GATE(CLK_ACLK_AXI2APB_ISP2P, "aclk_axi2apb_isp2p",
  4089. "div_aclk_isp_d_200", ENABLE_ACLK_ISP1,
  4090. 4, CLK_IGNORE_UNUSED, 0),
  4091. GATE(CLK_ACLK_AXI2APB_ISP1P, "aclk_axi2apb_isp1p",
  4092. "div_aclk_isp_c_200", ENABLE_ACLK_ISP1,
  4093. 3, CLK_IGNORE_UNUSED, 0),
  4094. GATE(CLK_ACLK_XIU_ISPEX1, "aclk_xiu_ispex1", "mout_aclk_isp_400_user",
  4095. ENABLE_ACLK_ISP1, 2, CLK_IGNORE_UNUSED, 0),
  4096. GATE(CLK_ACLK_XIU_ISPEX0, "aclk_xiu_ispex0", "mout_aclk_isp_400_user",
  4097. ENABLE_ACLK_ISP1, 1, CLK_IGNORE_UNUSED, 0),
  4098. GATE(CLK_ACLK_ISPND_400, "aclk_ispnd_400", "mout_aclk_isp_400_user",
  4099. ENABLE_ACLK_ISP1, 1, CLK_IGNORE_UNUSED, 0),
  4100. /* ENABLE_ACLK_ISP2 */
  4101. GATE(CLK_ACLK_SMMU_SCALERP, "aclk_smmu_scalerp",
  4102. "mout_aclk_isp_400_user", ENABLE_ACLK_ISP2,
  4103. 13, CLK_IGNORE_UNUSED, 0),
  4104. GATE(CLK_ACLK_SMMU_3DNR, "aclk_smmu_3dnr", "mout_aclk_isp_400_user",
  4105. ENABLE_ACLK_ISP2, 12, CLK_IGNORE_UNUSED, 0),
  4106. GATE(CLK_ACLK_SMMU_DIS1, "aclk_smmu_dis1", "mout_aclk_isp_400_user",
  4107. ENABLE_ACLK_ISP2, 11, CLK_IGNORE_UNUSED, 0),
  4108. GATE(CLK_ACLK_SMMU_DIS0, "aclk_smmu_dis0", "mout_aclk_isp_400_user",
  4109. ENABLE_ACLK_ISP2, 10, CLK_IGNORE_UNUSED, 0),
  4110. GATE(CLK_ACLK_SMMU_SCALERC, "aclk_smmu_scalerc",
  4111. "mout_aclk_isp_400_user", ENABLE_ACLK_ISP2,
  4112. 9, CLK_IGNORE_UNUSED, 0),
  4113. GATE(CLK_ACLK_SMMU_DRC, "aclk_smmu_drc", "mout_aclk_isp_400_user",
  4114. ENABLE_ACLK_ISP2, 8, CLK_IGNORE_UNUSED, 0),
  4115. GATE(CLK_ACLK_SMMU_ISP, "aclk_smmu_isp", "mout_aclk_isp_400_user",
  4116. ENABLE_ACLK_ISP2, 7, CLK_IGNORE_UNUSED, 0),
  4117. GATE(CLK_ACLK_BTS_SCALERP, "aclk_bts_scalerp",
  4118. "mout_aclk_isp_400_user", ENABLE_ACLK_ISP2,
  4119. 6, CLK_IGNORE_UNUSED, 0),
  4120. GATE(CLK_ACLK_BTS_3DR, "aclk_bts_3dnr", "mout_aclk_isp_400_user",
  4121. ENABLE_ACLK_ISP2, 5, CLK_IGNORE_UNUSED, 0),
  4122. GATE(CLK_ACLK_BTS_DIS1, "aclk_bts_dis1", "mout_aclk_isp_400_user",
  4123. ENABLE_ACLK_ISP2, 4, CLK_IGNORE_UNUSED, 0),
  4124. GATE(CLK_ACLK_BTS_DIS0, "aclk_bts_dis0", "mout_aclk_isp_400_user",
  4125. ENABLE_ACLK_ISP2, 3, CLK_IGNORE_UNUSED, 0),
  4126. GATE(CLK_ACLK_BTS_SCALERC, "aclk_bts_scalerc",
  4127. "mout_aclk_isp_400_user", ENABLE_ACLK_ISP2,
  4128. 2, CLK_IGNORE_UNUSED, 0),
  4129. GATE(CLK_ACLK_BTS_DRC, "aclk_bts_drc", "mout_aclk_isp_400_user",
  4130. ENABLE_ACLK_ISP2, 1, CLK_IGNORE_UNUSED, 0),
  4131. GATE(CLK_ACLK_BTS_ISP, "aclk_bts_isp", "mout_aclk_isp_400_user",
  4132. ENABLE_ACLK_ISP2, 0, CLK_IGNORE_UNUSED, 0),
  4133. /* ENABLE_PCLK_ISP */
  4134. GATE(CLK_PCLK_SMMU_SCALERP, "pclk_smmu_scalerp", "div_aclk_isp_d_200",
  4135. ENABLE_PCLK_ISP, 25, CLK_IGNORE_UNUSED, 0),
  4136. GATE(CLK_PCLK_SMMU_3DNR, "pclk_smmu_3dnr", "div_aclk_isp_d_200",
  4137. ENABLE_PCLK_ISP, 24, CLK_IGNORE_UNUSED, 0),
  4138. GATE(CLK_PCLK_SMMU_DIS1, "pclk_smmu_dis1", "div_aclk_isp_d_200",
  4139. ENABLE_PCLK_ISP, 23, CLK_IGNORE_UNUSED, 0),
  4140. GATE(CLK_PCLK_SMMU_DIS0, "pclk_smmu_dis0", "div_aclk_isp_d_200",
  4141. ENABLE_PCLK_ISP, 22, CLK_IGNORE_UNUSED, 0),
  4142. GATE(CLK_PCLK_SMMU_SCALERC, "pclk_smmu_scalerc", "div_aclk_isp_c_200",
  4143. ENABLE_PCLK_ISP, 21, CLK_IGNORE_UNUSED, 0),
  4144. GATE(CLK_PCLK_SMMU_DRC, "pclk_smmu_drc", "div_aclk_isp_c_200",
  4145. ENABLE_PCLK_ISP, 20, CLK_IGNORE_UNUSED, 0),
  4146. GATE(CLK_PCLK_SMMU_ISP, "pclk_smmu_isp", "div_aclk_isp_c_200",
  4147. ENABLE_PCLK_ISP, 19, CLK_IGNORE_UNUSED, 0),
  4148. GATE(CLK_PCLK_BTS_SCALERP, "pclk_bts_scalerp", "div_pclk_isp",
  4149. ENABLE_PCLK_ISP, 18, CLK_IGNORE_UNUSED, 0),
  4150. GATE(CLK_PCLK_BTS_3DNR, "pclk_bts_3dnr", "div_pclk_isp",
  4151. ENABLE_PCLK_ISP, 17, CLK_IGNORE_UNUSED, 0),
  4152. GATE(CLK_PCLK_BTS_DIS1, "pclk_bts_dis1", "div_pclk_isp",
  4153. ENABLE_PCLK_ISP, 16, CLK_IGNORE_UNUSED, 0),
  4154. GATE(CLK_PCLK_BTS_DIS0, "pclk_bts_dis0", "div_pclk_isp",
  4155. ENABLE_PCLK_ISP, 15, CLK_IGNORE_UNUSED, 0),
  4156. GATE(CLK_PCLK_BTS_SCALERC, "pclk_bts_scalerc", "div_pclk_isp",
  4157. ENABLE_PCLK_ISP, 14, CLK_IGNORE_UNUSED, 0),
  4158. GATE(CLK_PCLK_BTS_DRC, "pclk_bts_drc", "div_pclk_isp",
  4159. ENABLE_PCLK_ISP, 13, CLK_IGNORE_UNUSED, 0),
  4160. GATE(CLK_PCLK_BTS_ISP, "pclk_bts_isp", "div_pclk_isp",
  4161. ENABLE_PCLK_ISP, 12, CLK_IGNORE_UNUSED, 0),
  4162. GATE(CLK_PCLK_ASYNCAXI_DIS1, "pclk_asyncaxi_dis1", "div_pclk_isp",
  4163. ENABLE_PCLK_ISP, 11, CLK_IGNORE_UNUSED, 0),
  4164. GATE(CLK_PCLK_ASYNCAXI_DIS0, "pclk_asyncaxi_dis0", "div_pclk_isp",
  4165. ENABLE_PCLK_ISP, 10, CLK_IGNORE_UNUSED, 0),
  4166. GATE(CLK_PCLK_PMU_ISP, "pclk_pmu_isp", "div_pclk_isp",
  4167. ENABLE_PCLK_ISP, 9, CLK_IGNORE_UNUSED, 0),
  4168. GATE(CLK_PCLK_SYSREG_ISP, "pclk_sysreg_isp", "div_pclk_isp",
  4169. ENABLE_PCLK_ISP, 8, CLK_IGNORE_UNUSED, 0),
  4170. GATE(CLK_PCLK_CMU_ISP_LOCAL, "pclk_cmu_isp_local",
  4171. "div_aclk_isp_c_200", ENABLE_PCLK_ISP,
  4172. 7, CLK_IGNORE_UNUSED, 0),
  4173. GATE(CLK_PCLK_SCALERP, "pclk_scalerp", "div_aclk_isp_d_200",
  4174. ENABLE_PCLK_ISP, 6, CLK_IGNORE_UNUSED, 0),
  4175. GATE(CLK_PCLK_3DNR, "pclk_3dnr", "div_aclk_isp_d_200",
  4176. ENABLE_PCLK_ISP, 5, CLK_IGNORE_UNUSED, 0),
  4177. GATE(CLK_PCLK_DIS_CORE, "pclk_dis_core", "div_pclk_isp_dis",
  4178. ENABLE_PCLK_ISP, 4, CLK_IGNORE_UNUSED, 0),
  4179. GATE(CLK_PCLK_DIS, "pclk_dis", "div_aclk_isp_d_200",
  4180. ENABLE_PCLK_ISP, 3, CLK_IGNORE_UNUSED, 0),
  4181. GATE(CLK_PCLK_SCALERC, "pclk_scalerc", "div_aclk_isp_c_200",
  4182. ENABLE_PCLK_ISP, 2, CLK_IGNORE_UNUSED, 0),
  4183. GATE(CLK_PCLK_DRC, "pclk_drc", "div_aclk_isp_c_200",
  4184. ENABLE_PCLK_ISP, 1, CLK_IGNORE_UNUSED, 0),
  4185. GATE(CLK_PCLK_ISP, "pclk_isp", "div_aclk_isp_c_200",
  4186. ENABLE_PCLK_ISP, 0, CLK_IGNORE_UNUSED, 0),
  4187. /* ENABLE_SCLK_ISP */
  4188. GATE(CLK_SCLK_PIXELASYNCS_DIS, "sclk_pixelasyncs_dis",
  4189. "mout_aclk_isp_dis_400_user", ENABLE_SCLK_ISP,
  4190. 5, CLK_IGNORE_UNUSED, 0),
  4191. GATE(CLK_SCLK_PIXELASYNCM_DIS, "sclk_pixelasyncm_dis",
  4192. "mout_aclk_isp_dis_400_user", ENABLE_SCLK_ISP,
  4193. 4, CLK_IGNORE_UNUSED, 0),
  4194. GATE(CLK_SCLK_PIXELASYNCS_SCALERP, "sclk_pixelasyncs_scalerp",
  4195. "mout_aclk_isp_400_user", ENABLE_SCLK_ISP,
  4196. 3, CLK_IGNORE_UNUSED, 0),
  4197. GATE(CLK_SCLK_PIXELASYNCM_ISPD, "sclk_pixelasyncm_ispd",
  4198. "mout_aclk_isp_400_user", ENABLE_SCLK_ISP,
  4199. 2, CLK_IGNORE_UNUSED, 0),
  4200. GATE(CLK_SCLK_PIXELASYNCS_ISPC, "sclk_pixelasyncs_ispc",
  4201. "mout_aclk_isp_400_user", ENABLE_SCLK_ISP,
  4202. 1, CLK_IGNORE_UNUSED, 0),
  4203. GATE(CLK_SCLK_PIXELASYNCM_ISPC, "sclk_pixelasyncm_ispc",
  4204. "mout_aclk_isp_400_user", ENABLE_SCLK_ISP,
  4205. 0, CLK_IGNORE_UNUSED, 0),
  4206. };
  4207. static const struct samsung_cmu_info isp_cmu_info __initconst = {
  4208. .mux_clks = isp_mux_clks,
  4209. .nr_mux_clks = ARRAY_SIZE(isp_mux_clks),
  4210. .div_clks = isp_div_clks,
  4211. .nr_div_clks = ARRAY_SIZE(isp_div_clks),
  4212. .gate_clks = isp_gate_clks,
  4213. .nr_gate_clks = ARRAY_SIZE(isp_gate_clks),
  4214. .nr_clk_ids = ISP_NR_CLK,
  4215. .clk_regs = isp_clk_regs,
  4216. .nr_clk_regs = ARRAY_SIZE(isp_clk_regs),
  4217. };
  4218. static void __init exynos5433_cmu_isp_init(struct device_node *np)
  4219. {
  4220. samsung_cmu_register_one(np, &isp_cmu_info);
  4221. }
  4222. CLK_OF_DECLARE(exynos5433_cmu_isp, "samsung,exynos5433-cmu-isp",
  4223. exynos5433_cmu_isp_init);
  4224. /*
  4225. * Register offset definitions for CMU_CAM0
  4226. */
  4227. #define MUX_SEL_CAM00 0x0200
  4228. #define MUX_SEL_CAM01 0x0204
  4229. #define MUX_SEL_CAM02 0x0208
  4230. #define MUX_SEL_CAM03 0x020c
  4231. #define MUX_SEL_CAM04 0x0210
  4232. #define MUX_ENABLE_CAM00 0x0300
  4233. #define MUX_ENABLE_CAM01 0x0304
  4234. #define MUX_ENABLE_CAM02 0x0308
  4235. #define MUX_ENABLE_CAM03 0x030c
  4236. #define MUX_ENABLE_CAM04 0x0310
  4237. #define MUX_STAT_CAM00 0x0400
  4238. #define MUX_STAT_CAM01 0x0404
  4239. #define MUX_STAT_CAM02 0x0408
  4240. #define MUX_STAT_CAM03 0x040c
  4241. #define MUX_STAT_CAM04 0x0410
  4242. #define MUX_IGNORE_CAM01 0x0504
  4243. #define DIV_CAM00 0x0600
  4244. #define DIV_CAM01 0x0604
  4245. #define DIV_CAM02 0x0608
  4246. #define DIV_CAM03 0x060c
  4247. #define DIV_STAT_CAM00 0x0700
  4248. #define DIV_STAT_CAM01 0x0704
  4249. #define DIV_STAT_CAM02 0x0708
  4250. #define DIV_STAT_CAM03 0x070c
  4251. #define ENABLE_ACLK_CAM00 0X0800
  4252. #define ENABLE_ACLK_CAM01 0X0804
  4253. #define ENABLE_ACLK_CAM02 0X0808
  4254. #define ENABLE_PCLK_CAM0 0X0900
  4255. #define ENABLE_SCLK_CAM0 0X0a00
  4256. #define ENABLE_IP_CAM00 0X0b00
  4257. #define ENABLE_IP_CAM01 0X0b04
  4258. #define ENABLE_IP_CAM02 0X0b08
  4259. #define ENABLE_IP_CAM03 0X0b0C
  4260. static const unsigned long cam0_clk_regs[] __initconst = {
  4261. MUX_SEL_CAM00,
  4262. MUX_SEL_CAM01,
  4263. MUX_SEL_CAM02,
  4264. MUX_SEL_CAM03,
  4265. MUX_SEL_CAM04,
  4266. MUX_ENABLE_CAM00,
  4267. MUX_ENABLE_CAM01,
  4268. MUX_ENABLE_CAM02,
  4269. MUX_ENABLE_CAM03,
  4270. MUX_ENABLE_CAM04,
  4271. MUX_IGNORE_CAM01,
  4272. DIV_CAM00,
  4273. DIV_CAM01,
  4274. DIV_CAM02,
  4275. DIV_CAM03,
  4276. ENABLE_ACLK_CAM00,
  4277. ENABLE_ACLK_CAM01,
  4278. ENABLE_ACLK_CAM02,
  4279. ENABLE_PCLK_CAM0,
  4280. ENABLE_SCLK_CAM0,
  4281. ENABLE_IP_CAM00,
  4282. ENABLE_IP_CAM01,
  4283. ENABLE_IP_CAM02,
  4284. ENABLE_IP_CAM03,
  4285. };
  4286. PNAME(mout_aclk_cam0_333_user_p) = { "oscclk", "aclk_cam0_333", };
  4287. PNAME(mout_aclk_cam0_400_user_p) = { "oscclk", "aclk_cam0_400", };
  4288. PNAME(mout_aclk_cam0_552_user_p) = { "oscclk", "aclk_cam0_552", };
  4289. PNAME(mout_phyclk_rxbyteclkhs0_s4_user_p) = { "oscclk",
  4290. "phyclk_rxbyteclkhs0_s4_phy", };
  4291. PNAME(mout_phyclk_rxbyteclkhs0_s2a_user_p) = { "oscclk",
  4292. "phyclk_rxbyteclkhs0_s2a_phy", };
  4293. PNAME(mout_aclk_lite_d_b_p) = { "mout_aclk_lite_d_a",
  4294. "mout_aclk_cam0_333_user", };
  4295. PNAME(mout_aclk_lite_d_a_p) = { "mout_aclk_cam0_552_user",
  4296. "mout_aclk_cam0_400_user", };
  4297. PNAME(mout_aclk_lite_b_b_p) = { "mout_aclk_lite_b_a",
  4298. "mout_aclk_cam0_333_user", };
  4299. PNAME(mout_aclk_lite_b_a_p) = { "mout_aclk_cam0_552_user",
  4300. "mout_aclk_cam0_400_user", };
  4301. PNAME(mout_aclk_lite_a_b_p) = { "mout_aclk_lite_a_a",
  4302. "mout_aclk_cam0_333_user", };
  4303. PNAME(mout_aclk_lite_a_a_p) = { "mout_aclk_cam0_552_user",
  4304. "mout_aclk_cam0_400_user", };
  4305. PNAME(mout_aclk_cam0_400_p) = { "mout_aclk_cam0_400_user",
  4306. "mout_aclk_cam0_333_user", };
  4307. PNAME(mout_aclk_csis1_b_p) = { "mout_aclk_csis1_a",
  4308. "mout_aclk_cam0_333_user" };
  4309. PNAME(mout_aclk_csis1_a_p) = { "mout_aclk_cam0_552_user",
  4310. "mout_aclk_cam0_400_user", };
  4311. PNAME(mout_aclk_csis0_b_p) = { "mout_aclk_csis0_a",
  4312. "mout_aclk_cam0_333_user", };
  4313. PNAME(mout_aclk_csis0_a_p) = { "mout_aclk_cam0_552_user",
  4314. "mout_aclk-cam0_400_user", };
  4315. PNAME(mout_aclk_3aa1_b_p) = { "mout_aclk_3aa1_a",
  4316. "mout_aclk_cam0_333_user", };
  4317. PNAME(mout_aclk_3aa1_a_p) = { "mout_aclk_cam0_552_user",
  4318. "mout_aclk_cam0_400_user", };
  4319. PNAME(mout_aclk_3aa0_b_p) = { "mout_aclk_3aa0_a",
  4320. "mout_aclk_cam0_333_user", };
  4321. PNAME(mout_aclk_3aa0_a_p) = { "mout_aclk_cam0_552_user",
  4322. "mout_aclk_cam0_400_user", };
  4323. PNAME(mout_sclk_lite_freecnt_c_p) = { "mout_sclk_lite_freecnt_b",
  4324. "div_pclk_lite_d", };
  4325. PNAME(mout_sclk_lite_freecnt_b_p) = { "mout_sclk_lite_freecnt_a",
  4326. "div_pclk_pixelasync_lite_c", };
  4327. PNAME(mout_sclk_lite_freecnt_a_p) = { "div_pclk_lite_a",
  4328. "div_pclk_lite_b", };
  4329. PNAME(mout_sclk_pixelasync_lite_c_b_p) = { "mout_sclk_pixelasync_lite_c_a",
  4330. "mout_aclk_cam0_333_user", };
  4331. PNAME(mout_sclk_pixelasync_lite_c_a_p) = { "mout_aclk_cam0_552_user",
  4332. "mout_aclk_cam0_400_user", };
  4333. PNAME(mout_sclk_pixelasync_lite_c_init_b_p) = {
  4334. "mout_sclk_pixelasync_lite_c_init_a",
  4335. "mout_aclk_cam0_400_user", };
  4336. PNAME(mout_sclk_pixelasync_lite_c_init_a_p) = {
  4337. "mout_aclk_cam0_552_user",
  4338. "mout_aclk_cam0_400_user", };
  4339. static const struct samsung_fixed_rate_clock cam0_fixed_clks[] __initconst = {
  4340. FRATE(CLK_PHYCLK_RXBYTEECLKHS0_S4_PHY, "phyclk_rxbyteclkhs0_s4_phy",
  4341. NULL, 0, 100000000),
  4342. FRATE(CLK_PHYCLK_RXBYTEECLKHS0_S2A_PHY, "phyclk_rxbyteclkhs0_s2a_phy",
  4343. NULL, 0, 100000000),
  4344. };
  4345. static const struct samsung_mux_clock cam0_mux_clks[] __initconst = {
  4346. /* MUX_SEL_CAM00 */
  4347. MUX(CLK_MOUT_ACLK_CAM0_333_USER, "mout_aclk_cam0_333_user",
  4348. mout_aclk_cam0_333_user_p, MUX_SEL_CAM00, 8, 1),
  4349. MUX(CLK_MOUT_ACLK_CAM0_400_USER, "mout_aclk_cam0_400_user",
  4350. mout_aclk_cam0_400_user_p, MUX_SEL_CAM00, 4, 1),
  4351. MUX(CLK_MOUT_ACLK_CAM0_552_USER, "mout_aclk_cam0_552_user",
  4352. mout_aclk_cam0_552_user_p, MUX_SEL_CAM00, 0, 1),
  4353. /* MUX_SEL_CAM01 */
  4354. MUX(CLK_MOUT_PHYCLK_RXBYTECLKHS0_S4_USER,
  4355. "mout_phyclk_rxbyteclkhs0_s4_user",
  4356. mout_phyclk_rxbyteclkhs0_s4_user_p,
  4357. MUX_SEL_CAM01, 4, 1),
  4358. MUX(CLK_MOUT_PHYCLK_RXBYTECLKHS0_S2A_USER,
  4359. "mout_phyclk_rxbyteclkhs0_s2a_user",
  4360. mout_phyclk_rxbyteclkhs0_s2a_user_p,
  4361. MUX_SEL_CAM01, 0, 1),
  4362. /* MUX_SEL_CAM02 */
  4363. MUX(CLK_MOUT_ACLK_LITE_D_B, "mout_aclk_lite_d_b", mout_aclk_lite_d_b_p,
  4364. MUX_SEL_CAM02, 24, 1),
  4365. MUX(CLK_MOUT_ACLK_LITE_D_A, "mout_aclk_lite_d_a", mout_aclk_lite_d_a_p,
  4366. MUX_SEL_CAM02, 20, 1),
  4367. MUX(CLK_MOUT_ACLK_LITE_B_B, "mout_aclk_lite_b_b", mout_aclk_lite_b_b_p,
  4368. MUX_SEL_CAM02, 16, 1),
  4369. MUX(CLK_MOUT_ACLK_LITE_B_A, "mout_aclk_lite_b_a", mout_aclk_lite_b_a_p,
  4370. MUX_SEL_CAM02, 12, 1),
  4371. MUX(CLK_MOUT_ACLK_LITE_A_B, "mout_aclk_lite_a_b", mout_aclk_lite_a_b_p,
  4372. MUX_SEL_CAM02, 8, 1),
  4373. MUX(CLK_MOUT_ACLK_LITE_A_A, "mout_aclk_lite_a_a", mout_aclk_lite_a_a_p,
  4374. MUX_SEL_CAM02, 4, 1),
  4375. MUX(CLK_MOUT_ACLK_CAM0_400, "mout_aclk_cam0_400", mout_aclk_cam0_400_p,
  4376. MUX_SEL_CAM02, 0, 1),
  4377. /* MUX_SEL_CAM03 */
  4378. MUX(CLK_MOUT_ACLK_CSIS1_B, "mout_aclk_csis1_b", mout_aclk_csis1_b_p,
  4379. MUX_SEL_CAM03, 28, 1),
  4380. MUX(CLK_MOUT_ACLK_CSIS1_A, "mout_aclk_csis1_a", mout_aclk_csis1_a_p,
  4381. MUX_SEL_CAM03, 24, 1),
  4382. MUX(CLK_MOUT_ACLK_CSIS0_B, "mout_aclk_csis0_b", mout_aclk_csis0_b_p,
  4383. MUX_SEL_CAM03, 20, 1),
  4384. MUX(CLK_MOUT_ACLK_CSIS0_A, "mout_aclk_csis0_a", mout_aclk_csis0_a_p,
  4385. MUX_SEL_CAM03, 16, 1),
  4386. MUX(CLK_MOUT_ACLK_3AA1_B, "mout_aclk_3aa1_b", mout_aclk_3aa1_b_p,
  4387. MUX_SEL_CAM03, 12, 1),
  4388. MUX(CLK_MOUT_ACLK_3AA1_A, "mout_aclk_3aa1_a", mout_aclk_3aa1_a_p,
  4389. MUX_SEL_CAM03, 8, 1),
  4390. MUX(CLK_MOUT_ACLK_3AA0_B, "mout_aclk_3aa0_b", mout_aclk_3aa0_b_p,
  4391. MUX_SEL_CAM03, 4, 1),
  4392. MUX(CLK_MOUT_ACLK_3AA0_A, "mout_aclk_3aa0_a", mout_aclk_3aa0_a_p,
  4393. MUX_SEL_CAM03, 0, 1),
  4394. /* MUX_SEL_CAM04 */
  4395. MUX(CLK_MOUT_SCLK_LITE_FREECNT_C, "mout_sclk_lite_freecnt_c",
  4396. mout_sclk_lite_freecnt_c_p, MUX_SEL_CAM04, 24, 1),
  4397. MUX(CLK_MOUT_SCLK_LITE_FREECNT_B, "mout_sclk_lite_freecnt_b",
  4398. mout_sclk_lite_freecnt_b_p, MUX_SEL_CAM04, 20, 1),
  4399. MUX(CLK_MOUT_SCLK_LITE_FREECNT_A, "mout_sclk_lite_freecnt_a",
  4400. mout_sclk_lite_freecnt_a_p, MUX_SEL_CAM04, 16, 1),
  4401. MUX(CLK_MOUT_SCLK_PIXELASYNC_LITE_C_B, "mout_sclk_pixelasync_lite_c_b",
  4402. mout_sclk_pixelasync_lite_c_b_p, MUX_SEL_CAM04, 12, 1),
  4403. MUX(CLK_MOUT_SCLK_PIXELASYNC_LITE_C_A, "mout_sclk_pixelasync_lite_c_a",
  4404. mout_sclk_pixelasync_lite_c_a_p, MUX_SEL_CAM04, 8, 1),
  4405. MUX(CLK_MOUT_SCLK_PIXELASYNC_LITE_C_INIT_B,
  4406. "mout_sclk_pixelasync_lite_c_init_b",
  4407. mout_sclk_pixelasync_lite_c_init_b_p,
  4408. MUX_SEL_CAM04, 4, 1),
  4409. MUX(CLK_MOUT_SCLK_PIXELASYNC_LITE_C_INIT_A,
  4410. "mout_sclk_pixelasync_lite_c_init_a",
  4411. mout_sclk_pixelasync_lite_c_init_a_p,
  4412. MUX_SEL_CAM04, 0, 1),
  4413. };
  4414. static const struct samsung_div_clock cam0_div_clks[] __initconst = {
  4415. /* DIV_CAM00 */
  4416. DIV(CLK_DIV_PCLK_CAM0_50, "div_pclk_cam0_50", "div_aclk_cam0_200",
  4417. DIV_CAM00, 8, 2),
  4418. DIV(CLK_DIV_ACLK_CAM0_200, "div_aclk_cam0_200", "mout_aclk_cam0_400",
  4419. DIV_CAM00, 4, 3),
  4420. DIV(CLK_DIV_ACLK_CAM0_BUS_400, "div_aclk_cam0_bus_400",
  4421. "mout_aclk_cam0_400", DIV_CAM00, 0, 3),
  4422. /* DIV_CAM01 */
  4423. DIV(CLK_DIV_PCLK_LITE_D, "div_pclk_lite_d", "div_aclk_lite_d",
  4424. DIV_CAM01, 20, 2),
  4425. DIV(CLK_DIV_ACLK_LITE_D, "div_aclk_lite_d", "mout_aclk_lite_d_b",
  4426. DIV_CAM01, 16, 3),
  4427. DIV(CLK_DIV_PCLK_LITE_B, "div_pclk_lite_b", "div_aclk_lite_b",
  4428. DIV_CAM01, 12, 2),
  4429. DIV(CLK_DIV_ACLK_LITE_B, "div_aclk_lite_b", "mout_aclk_lite_b_b",
  4430. DIV_CAM01, 8, 3),
  4431. DIV(CLK_DIV_PCLK_LITE_A, "div_pclk_lite_a", "div_aclk_lite_a",
  4432. DIV_CAM01, 4, 2),
  4433. DIV(CLK_DIV_ACLK_LITE_A, "div_aclk_lite_a", "mout_aclk_lite_a_b",
  4434. DIV_CAM01, 0, 3),
  4435. /* DIV_CAM02 */
  4436. DIV(CLK_DIV_ACLK_CSIS1, "div_aclk_csis1", "mout_aclk_csis1_b",
  4437. DIV_CAM02, 20, 3),
  4438. DIV(CLK_DIV_ACLK_CSIS0, "div_aclk_csis0", "mout_aclk_csis0_b",
  4439. DIV_CAM02, 16, 3),
  4440. DIV(CLK_DIV_PCLK_3AA1, "div_pclk_3aa1", "div_aclk_3aa1",
  4441. DIV_CAM02, 12, 2),
  4442. DIV(CLK_DIV_ACLK_3AA1, "div_aclk_3aa1", "mout_aclk_3aa1_b",
  4443. DIV_CAM02, 8, 3),
  4444. DIV(CLK_DIV_PCLK_3AA0, "div_pclk_3aa0", "div_aclk_3aa0",
  4445. DIV_CAM02, 4, 2),
  4446. DIV(CLK_DIV_ACLK_3AA0, "div_aclk_3aa0", "mout_aclk_3aa0_b",
  4447. DIV_CAM02, 0, 3),
  4448. /* DIV_CAM03 */
  4449. DIV(CLK_DIV_SCLK_PIXELASYNC_LITE_C, "div_sclk_pixelasync_lite_c",
  4450. "mout_sclk_pixelasync_lite_c_b", DIV_CAM03, 8, 3),
  4451. DIV(CLK_DIV_PCLK_PIXELASYNC_LITE_C, "div_pclk_pixelasync_lite_c",
  4452. "div_sclk_pixelasync_lite_c_init", DIV_CAM03, 4, 2),
  4453. DIV(CLK_DIV_SCLK_PIXELASYNC_LITE_C_INIT,
  4454. "div_sclk_pixelasync_lite_c_init",
  4455. "mout_sclk_pixelasync_lite_c_init_b", DIV_CAM03, 0, 3),
  4456. };
  4457. static const struct samsung_gate_clock cam0_gate_clks[] __initconst = {
  4458. /* ENABLE_ACLK_CAM00 */
  4459. GATE(CLK_ACLK_CSIS1, "aclk_csis1", "div_aclk_csis1", ENABLE_ACLK_CAM00,
  4460. 6, 0, 0),
  4461. GATE(CLK_ACLK_CSIS0, "aclk_csis0", "div_aclk_csis0", ENABLE_ACLK_CAM00,
  4462. 5, 0, 0),
  4463. GATE(CLK_ACLK_3AA1, "aclk_3aa1", "div_aclk_3aa1", ENABLE_ACLK_CAM00,
  4464. 4, 0, 0),
  4465. GATE(CLK_ACLK_3AA0, "aclk_3aa0", "div_aclk_3aa0", ENABLE_ACLK_CAM00,
  4466. 3, 0, 0),
  4467. GATE(CLK_ACLK_LITE_D, "aclk_lite_d", "div_aclk_lite_d",
  4468. ENABLE_ACLK_CAM00, 2, 0, 0),
  4469. GATE(CLK_ACLK_LITE_B, "aclk_lite_b", "div_aclk_lite_b",
  4470. ENABLE_ACLK_CAM00, 1, 0, 0),
  4471. GATE(CLK_ACLK_LITE_A, "aclk_lite_a", "div_aclk_lite_a",
  4472. ENABLE_ACLK_CAM00, 0, 0, 0),
  4473. /* ENABLE_ACLK_CAM01 */
  4474. GATE(CLK_ACLK_AHBSYNCDN, "aclk_ahbsyncdn", "div_aclk_cam0_200",
  4475. ENABLE_ACLK_CAM01, 31, CLK_IGNORE_UNUSED, 0),
  4476. GATE(CLK_ACLK_AXIUS_LITE_D, "aclk_axius_lite_d", "div_aclk_cam0_bus_400",
  4477. ENABLE_ACLK_CAM01, 30, CLK_IGNORE_UNUSED, 0),
  4478. GATE(CLK_ACLK_AXIUS_LITE_B, "aclk_axius_lite_b", "div_aclk_cam0_bus_400",
  4479. ENABLE_ACLK_CAM01, 29, CLK_IGNORE_UNUSED, 0),
  4480. GATE(CLK_ACLK_AXIUS_LITE_A, "aclk_axius_lite_a", "div_aclk_cam0_bus_400",
  4481. ENABLE_ACLK_CAM01, 28, CLK_IGNORE_UNUSED, 0),
  4482. GATE(CLK_ACLK_ASYNCAPBM_3AA1, "aclk_asyncapbm_3aa1", "div_pclk_3aa1",
  4483. ENABLE_ACLK_CAM01, 27, CLK_IGNORE_UNUSED, 0),
  4484. GATE(CLK_ACLK_ASYNCAPBS_3AA1, "aclk_asyncapbs_3aa1", "div_aclk_3aa1",
  4485. ENABLE_ACLK_CAM01, 26, CLK_IGNORE_UNUSED, 0),
  4486. GATE(CLK_ACLK_ASYNCAPBM_3AA0, "aclk_asyncapbm_3aa0", "div_pclk_3aa0",
  4487. ENABLE_ACLK_CAM01, 25, CLK_IGNORE_UNUSED, 0),
  4488. GATE(CLK_ACLK_ASYNCAPBS_3AA0, "aclk_asyncapbs_3aa0", "div_aclk_3aa0",
  4489. ENABLE_ACLK_CAM01, 24, CLK_IGNORE_UNUSED, 0),
  4490. GATE(CLK_ACLK_ASYNCAPBM_LITE_D, "aclk_asyncapbm_lite_d",
  4491. "div_pclk_lite_d", ENABLE_ACLK_CAM01,
  4492. 23, CLK_IGNORE_UNUSED, 0),
  4493. GATE(CLK_ACLK_ASYNCAPBS_LITE_D, "aclk_asyncapbs_lite_d",
  4494. "div_aclk_cam0_200", ENABLE_ACLK_CAM01,
  4495. 22, CLK_IGNORE_UNUSED, 0),
  4496. GATE(CLK_ACLK_ASYNCAPBM_LITE_B, "aclk_asyncapbm_lite_b",
  4497. "div_pclk_lite_b", ENABLE_ACLK_CAM01,
  4498. 21, CLK_IGNORE_UNUSED, 0),
  4499. GATE(CLK_ACLK_ASYNCAPBS_LITE_B, "aclk_asyncapbs_lite_b",
  4500. "div_aclk_cam0_200", ENABLE_ACLK_CAM01,
  4501. 20, CLK_IGNORE_UNUSED, 0),
  4502. GATE(CLK_ACLK_ASYNCAPBM_LITE_A, "aclk_asyncapbm_lite_a",
  4503. "div_pclk_lite_a", ENABLE_ACLK_CAM01,
  4504. 19, CLK_IGNORE_UNUSED, 0),
  4505. GATE(CLK_ACLK_ASYNCAPBS_LITE_A, "aclk_asyncapbs_lite_a",
  4506. "div_aclk_cam0_200", ENABLE_ACLK_CAM01,
  4507. 18, CLK_IGNORE_UNUSED, 0),
  4508. GATE(CLK_ACLK_ASYNCAXIM_ISP0P, "aclk_asyncaxim_isp0p",
  4509. "div_aclk_cam0_200", ENABLE_ACLK_CAM01,
  4510. 17, CLK_IGNORE_UNUSED, 0),
  4511. GATE(CLK_ACLK_ASYNCAXIM_3AA1, "aclk_asyncaxim_3aa1",
  4512. "div_aclk_cam0_bus_400", ENABLE_ACLK_CAM01,
  4513. 16, CLK_IGNORE_UNUSED, 0),
  4514. GATE(CLK_ACLK_ASYNCAXIS_3AA1, "aclk_asyncaxis_3aa1",
  4515. "div_aclk_3aa1", ENABLE_ACLK_CAM01,
  4516. 15, CLK_IGNORE_UNUSED, 0),
  4517. GATE(CLK_ACLK_ASYNCAXIM_3AA0, "aclk_asyncaxim_3aa0",
  4518. "div_aclk_cam0_bus_400", ENABLE_ACLK_CAM01,
  4519. 14, CLK_IGNORE_UNUSED, 0),
  4520. GATE(CLK_ACLK_ASYNCAXIS_3AA0, "aclk_asyncaxis_3aa0",
  4521. "div_aclk_3aa0", ENABLE_ACLK_CAM01,
  4522. 13, CLK_IGNORE_UNUSED, 0),
  4523. GATE(CLK_ACLK_ASYNCAXIM_LITE_D, "aclk_asyncaxim_lite_d",
  4524. "div_aclk_cam0_bus_400", ENABLE_ACLK_CAM01,
  4525. 12, CLK_IGNORE_UNUSED, 0),
  4526. GATE(CLK_ACLK_ASYNCAXIS_LITE_D, "aclk_asyncaxis_lite_d",
  4527. "div_aclk_lite_d", ENABLE_ACLK_CAM01,
  4528. 11, CLK_IGNORE_UNUSED, 0),
  4529. GATE(CLK_ACLK_ASYNCAXIM_LITE_B, "aclk_asyncaxim_lite_b",
  4530. "div_aclk_cam0_bus_400", ENABLE_ACLK_CAM01,
  4531. 10, CLK_IGNORE_UNUSED, 0),
  4532. GATE(CLK_ACLK_ASYNCAXIS_LITE_B, "aclk_asyncaxis_lite_b",
  4533. "div_aclk_lite_b", ENABLE_ACLK_CAM01,
  4534. 9, CLK_IGNORE_UNUSED, 0),
  4535. GATE(CLK_ACLK_ASYNCAXIM_LITE_A, "aclk_asyncaxim_lite_a",
  4536. "div_aclk_cam0_bus_400", ENABLE_ACLK_CAM01,
  4537. 8, CLK_IGNORE_UNUSED, 0),
  4538. GATE(CLK_ACLK_ASYNCAXIS_LITE_A, "aclk_asyncaxis_lite_a",
  4539. "div_aclk_lite_a", ENABLE_ACLK_CAM01,
  4540. 7, CLK_IGNORE_UNUSED, 0),
  4541. GATE(CLK_ACLK_AHB2APB_ISPSFRP, "aclk_ahb2apb_ispsfrp",
  4542. "div_pclk_cam0_50", ENABLE_ACLK_CAM01,
  4543. 6, CLK_IGNORE_UNUSED, 0),
  4544. GATE(CLK_ACLK_AXI2APB_ISP0P, "aclk_axi2apb_isp0p", "div_aclk_cam0_200",
  4545. ENABLE_ACLK_CAM01, 5, CLK_IGNORE_UNUSED, 0),
  4546. GATE(CLK_ACLK_AXI2AHB_ISP0P, "aclk_axi2ahb_isp0p", "div_aclk_cam0_200",
  4547. ENABLE_ACLK_CAM01, 4, CLK_IGNORE_UNUSED, 0),
  4548. GATE(CLK_ACLK_XIU_IS0X, "aclk_xiu_is0x", "div_aclk_cam0_200",
  4549. ENABLE_ACLK_CAM01, 3, CLK_IGNORE_UNUSED, 0),
  4550. GATE(CLK_ACLK_XIU_ISP0EX, "aclk_xiu_isp0ex", "div_aclk_cam0_bus_400",
  4551. ENABLE_ACLK_CAM01, 2, CLK_IGNORE_UNUSED, 0),
  4552. GATE(CLK_ACLK_CAM0NP_276, "aclk_cam0np_276", "div_aclk_cam0_200",
  4553. ENABLE_ACLK_CAM01, 1, CLK_IGNORE_UNUSED, 0),
  4554. GATE(CLK_ACLK_CAM0ND_400, "aclk_cam0nd_400", "div_aclk_cam0_bus_400",
  4555. ENABLE_ACLK_CAM01, 0, CLK_IGNORE_UNUSED, 0),
  4556. /* ENABLE_ACLK_CAM02 */
  4557. GATE(CLK_ACLK_SMMU_3AA1, "aclk_smmu_3aa1", "div_aclk_cam0_bus_400",
  4558. ENABLE_ACLK_CAM02, 9, CLK_IGNORE_UNUSED, 0),
  4559. GATE(CLK_ACLK_SMMU_3AA0, "aclk_smmu_3aa0", "div_aclk_cam0_bus_400",
  4560. ENABLE_ACLK_CAM02, 8, CLK_IGNORE_UNUSED, 0),
  4561. GATE(CLK_ACLK_SMMU_LITE_D, "aclk_smmu_lite_d", "div_aclk_cam0_bus_400",
  4562. ENABLE_ACLK_CAM02, 7, CLK_IGNORE_UNUSED, 0),
  4563. GATE(CLK_ACLK_SMMU_LITE_B, "aclk_smmu_lite_b", "div_aclk_cam0_bus_400",
  4564. ENABLE_ACLK_CAM02, 6, CLK_IGNORE_UNUSED, 0),
  4565. GATE(CLK_ACLK_SMMU_LITE_A, "aclk_smmu_lite_a", "div_aclk_cam0_bus_400",
  4566. ENABLE_ACLK_CAM02, 5, CLK_IGNORE_UNUSED, 0),
  4567. GATE(CLK_ACLK_BTS_3AA1, "aclk_bts_3aa1", "div_aclk_cam0_bus_400",
  4568. ENABLE_ACLK_CAM02, 4, CLK_IGNORE_UNUSED, 0),
  4569. GATE(CLK_ACLK_BTS_3AA0, "aclk_bts_3aa0", "div_aclk_cam0_bus_400",
  4570. ENABLE_ACLK_CAM02, 3, CLK_IGNORE_UNUSED, 0),
  4571. GATE(CLK_ACLK_BTS_LITE_D, "aclk_bts_lite_d", "div_aclk_cam0_bus_400",
  4572. ENABLE_ACLK_CAM02, 2, CLK_IGNORE_UNUSED, 0),
  4573. GATE(CLK_ACLK_BTS_LITE_B, "aclk_bts_lite_b", "div_aclk_cam0_bus_400",
  4574. ENABLE_ACLK_CAM02, 1, CLK_IGNORE_UNUSED, 0),
  4575. GATE(CLK_ACLK_BTS_LITE_A, "aclk_bts_lite_a", "div_aclk_cam0_bus_400",
  4576. ENABLE_ACLK_CAM02, 0, CLK_IGNORE_UNUSED, 0),
  4577. /* ENABLE_PCLK_CAM0 */
  4578. GATE(CLK_PCLK_SMMU_3AA1, "pclk_smmu_3aa1", "div_aclk_cam0_200",
  4579. ENABLE_PCLK_CAM0, 25, CLK_IGNORE_UNUSED, 0),
  4580. GATE(CLK_PCLK_SMMU_3AA0, "pclk_smmu_3aa0", "div_aclk_cam0_200",
  4581. ENABLE_PCLK_CAM0, 24, CLK_IGNORE_UNUSED, 0),
  4582. GATE(CLK_PCLK_SMMU_LITE_D, "pclk_smmu_lite_d", "div_aclk_cam0_200",
  4583. ENABLE_PCLK_CAM0, 23, CLK_IGNORE_UNUSED, 0),
  4584. GATE(CLK_PCLK_SMMU_LITE_B, "pclk_smmu_lite_b", "div_aclk_cam0_200",
  4585. ENABLE_PCLK_CAM0, 22, CLK_IGNORE_UNUSED, 0),
  4586. GATE(CLK_PCLK_SMMU_LITE_A, "pclk_smmu_lite_a", "div_aclk_cam0_200",
  4587. ENABLE_PCLK_CAM0, 21, CLK_IGNORE_UNUSED, 0),
  4588. GATE(CLK_PCLK_BTS_3AA1, "pclk_bts_3aa1", "div_pclk_cam0_50",
  4589. ENABLE_PCLK_CAM0, 20, CLK_IGNORE_UNUSED, 0),
  4590. GATE(CLK_PCLK_BTS_3AA0, "pclk_bts_3aa0", "div_pclk_cam0_50",
  4591. ENABLE_PCLK_CAM0, 19, CLK_IGNORE_UNUSED, 0),
  4592. GATE(CLK_PCLK_BTS_LITE_D, "pclk_bts_lite_d", "div_pclk_cam0_50",
  4593. ENABLE_PCLK_CAM0, 18, CLK_IGNORE_UNUSED, 0),
  4594. GATE(CLK_PCLK_BTS_LITE_B, "pclk_bts_lite_b", "div_pclk_cam0_50",
  4595. ENABLE_PCLK_CAM0, 17, CLK_IGNORE_UNUSED, 0),
  4596. GATE(CLK_PCLK_BTS_LITE_A, "pclk_bts_lite_a", "div_pclk_cam0_50",
  4597. ENABLE_PCLK_CAM0, 16, CLK_IGNORE_UNUSED, 0),
  4598. GATE(CLK_PCLK_ASYNCAXI_CAM1, "pclk_asyncaxi_cam1", "div_pclk_cam0_50",
  4599. ENABLE_PCLK_CAM0, 15, CLK_IGNORE_UNUSED, 0),
  4600. GATE(CLK_PCLK_ASYNCAXI_3AA1, "pclk_asyncaxi_3aa1", "div_pclk_cam0_50",
  4601. ENABLE_PCLK_CAM0, 14, CLK_IGNORE_UNUSED, 0),
  4602. GATE(CLK_PCLK_ASYNCAXI_3AA0, "pclk_asyncaxi_3aa0", "div_pclk_cam0_50",
  4603. ENABLE_PCLK_CAM0, 13, CLK_IGNORE_UNUSED, 0),
  4604. GATE(CLK_PCLK_ASYNCAXI_LITE_D, "pclk_asyncaxi_lite_d",
  4605. "div_pclk_cam0_50", ENABLE_PCLK_CAM0,
  4606. 12, CLK_IGNORE_UNUSED, 0),
  4607. GATE(CLK_PCLK_ASYNCAXI_LITE_B, "pclk_asyncaxi_lite_b",
  4608. "div_pclk_cam0_50", ENABLE_PCLK_CAM0,
  4609. 11, CLK_IGNORE_UNUSED, 0),
  4610. GATE(CLK_PCLK_ASYNCAXI_LITE_A, "pclk_asyncaxi_lite_a",
  4611. "div_pclk_cam0_50", ENABLE_PCLK_CAM0,
  4612. 10, CLK_IGNORE_UNUSED, 0),
  4613. GATE(CLK_PCLK_PMU_CAM0, "pclk_pmu_cam0", "div_pclk_cam0_50",
  4614. ENABLE_PCLK_CAM0, 9, CLK_IGNORE_UNUSED, 0),
  4615. GATE(CLK_PCLK_SYSREG_CAM0, "pclk_sysreg_cam0", "div_pclk_cam0_50",
  4616. ENABLE_PCLK_CAM0, 8, CLK_IGNORE_UNUSED, 0),
  4617. GATE(CLK_PCLK_CMU_CAM0_LOCAL, "pclk_cmu_cam0_local",
  4618. "div_aclk_cam0_200", ENABLE_PCLK_CAM0,
  4619. 7, CLK_IGNORE_UNUSED, 0),
  4620. GATE(CLK_PCLK_CSIS1, "pclk_csis1", "div_aclk_cam0_200",
  4621. ENABLE_PCLK_CAM0, 6, CLK_IGNORE_UNUSED, 0),
  4622. GATE(CLK_PCLK_CSIS0, "pclk_csis0", "div_aclk_cam0_200",
  4623. ENABLE_PCLK_CAM0, 5, CLK_IGNORE_UNUSED, 0),
  4624. GATE(CLK_PCLK_3AA1, "pclk_3aa1", "div_pclk_3aa1",
  4625. ENABLE_PCLK_CAM0, 4, CLK_IGNORE_UNUSED, 0),
  4626. GATE(CLK_PCLK_3AA0, "pclk_3aa0", "div_pclk_3aa0",
  4627. ENABLE_PCLK_CAM0, 3, CLK_IGNORE_UNUSED, 0),
  4628. GATE(CLK_PCLK_LITE_D, "pclk_lite_d", "div_pclk_lite_d",
  4629. ENABLE_PCLK_CAM0, 2, CLK_IGNORE_UNUSED, 0),
  4630. GATE(CLK_PCLK_LITE_B, "pclk_lite_b", "div_pclk_lite_b",
  4631. ENABLE_PCLK_CAM0, 1, CLK_IGNORE_UNUSED, 0),
  4632. GATE(CLK_PCLK_LITE_A, "pclk_lite_a", "div_pclk_lite_a",
  4633. ENABLE_PCLK_CAM0, 0, CLK_IGNORE_UNUSED, 0),
  4634. /* ENABLE_SCLK_CAM0 */
  4635. GATE(CLK_PHYCLK_RXBYTECLKHS0_S4, "phyclk_rxbyteclkhs0_s4",
  4636. "mout_phyclk_rxbyteclkhs0_s4_user",
  4637. ENABLE_SCLK_CAM0, 8, 0, 0),
  4638. GATE(CLK_PHYCLK_RXBYTECLKHS0_S2A, "phyclk_rxbyteclkhs0_s2a",
  4639. "mout_phyclk_rxbyteclkhs0_s2a_user",
  4640. ENABLE_SCLK_CAM0, 7, 0, 0),
  4641. GATE(CLK_SCLK_LITE_FREECNT, "sclk_lite_freecnt",
  4642. "mout_sclk_lite_freecnt_c", ENABLE_SCLK_CAM0, 6, 0, 0),
  4643. GATE(CLK_SCLK_PIXELASYNCM_3AA1, "sclk_pixelasycm_3aa1",
  4644. "div_aclk_3aa1", ENABLE_SCLK_CAM0, 5, 0, 0),
  4645. GATE(CLK_SCLK_PIXELASYNCM_3AA0, "sclk_pixelasycm_3aa0",
  4646. "div_aclk_3aa0", ENABLE_SCLK_CAM0, 4, 0, 0),
  4647. GATE(CLK_SCLK_PIXELASYNCS_3AA0, "sclk_pixelasycs_3aa0",
  4648. "div_aclk_3aa0", ENABLE_SCLK_CAM0, 3, 0, 0),
  4649. GATE(CLK_SCLK_PIXELASYNCM_LITE_C, "sclk_pixelasyncm_lite_c",
  4650. "div_sclk_pixelasync_lite_c",
  4651. ENABLE_SCLK_CAM0, 2, 0, 0),
  4652. GATE(CLK_SCLK_PIXELASYNCM_LITE_C_INIT, "sclk_pixelasyncm_lite_c_init",
  4653. "div_sclk_pixelasync_lite_c_init",
  4654. ENABLE_SCLK_CAM0, 1, 0, 0),
  4655. GATE(CLK_SCLK_PIXELASYNCS_LITE_C_INIT, "sclk_pixelasyncs_lite_c_init",
  4656. "div_sclk_pixelasync_lite_c",
  4657. ENABLE_SCLK_CAM0, 0, 0, 0),
  4658. };
  4659. static const struct samsung_cmu_info cam0_cmu_info __initconst = {
  4660. .mux_clks = cam0_mux_clks,
  4661. .nr_mux_clks = ARRAY_SIZE(cam0_mux_clks),
  4662. .div_clks = cam0_div_clks,
  4663. .nr_div_clks = ARRAY_SIZE(cam0_div_clks),
  4664. .gate_clks = cam0_gate_clks,
  4665. .nr_gate_clks = ARRAY_SIZE(cam0_gate_clks),
  4666. .fixed_clks = cam0_fixed_clks,
  4667. .nr_fixed_clks = ARRAY_SIZE(cam0_fixed_clks),
  4668. .nr_clk_ids = CAM0_NR_CLK,
  4669. .clk_regs = cam0_clk_regs,
  4670. .nr_clk_regs = ARRAY_SIZE(cam0_clk_regs),
  4671. };
  4672. static void __init exynos5433_cmu_cam0_init(struct device_node *np)
  4673. {
  4674. samsung_cmu_register_one(np, &cam0_cmu_info);
  4675. }
  4676. CLK_OF_DECLARE(exynos5433_cmu_cam0, "samsung,exynos5433-cmu-cam0",
  4677. exynos5433_cmu_cam0_init);
  4678. /*
  4679. * Register offset definitions for CMU_CAM1
  4680. */
  4681. #define MUX_SEL_CAM10 0x0200
  4682. #define MUX_SEL_CAM11 0x0204
  4683. #define MUX_SEL_CAM12 0x0208
  4684. #define MUX_ENABLE_CAM10 0x0300
  4685. #define MUX_ENABLE_CAM11 0x0304
  4686. #define MUX_ENABLE_CAM12 0x0308
  4687. #define MUX_STAT_CAM10 0x0400
  4688. #define MUX_STAT_CAM11 0x0404
  4689. #define MUX_STAT_CAM12 0x0408
  4690. #define MUX_IGNORE_CAM11 0x0504
  4691. #define DIV_CAM10 0x0600
  4692. #define DIV_CAM11 0x0604
  4693. #define DIV_STAT_CAM10 0x0700
  4694. #define DIV_STAT_CAM11 0x0704
  4695. #define ENABLE_ACLK_CAM10 0X0800
  4696. #define ENABLE_ACLK_CAM11 0X0804
  4697. #define ENABLE_ACLK_CAM12 0X0808
  4698. #define ENABLE_PCLK_CAM1 0X0900
  4699. #define ENABLE_SCLK_CAM1 0X0a00
  4700. #define ENABLE_IP_CAM10 0X0b00
  4701. #define ENABLE_IP_CAM11 0X0b04
  4702. #define ENABLE_IP_CAM12 0X0b08
  4703. static const unsigned long cam1_clk_regs[] __initconst = {
  4704. MUX_SEL_CAM10,
  4705. MUX_SEL_CAM11,
  4706. MUX_SEL_CAM12,
  4707. MUX_ENABLE_CAM10,
  4708. MUX_ENABLE_CAM11,
  4709. MUX_ENABLE_CAM12,
  4710. MUX_IGNORE_CAM11,
  4711. DIV_CAM10,
  4712. DIV_CAM11,
  4713. ENABLE_ACLK_CAM10,
  4714. ENABLE_ACLK_CAM11,
  4715. ENABLE_ACLK_CAM12,
  4716. ENABLE_PCLK_CAM1,
  4717. ENABLE_SCLK_CAM1,
  4718. ENABLE_IP_CAM10,
  4719. ENABLE_IP_CAM11,
  4720. ENABLE_IP_CAM12,
  4721. };
  4722. PNAME(mout_sclk_isp_uart_user_p) = { "oscclk", "sclk_isp_uart_cam1", };
  4723. PNAME(mout_sclk_isp_spi1_user_p) = { "oscclk", "sclk_isp_spi1_cam1", };
  4724. PNAME(mout_sclk_isp_spi0_user_p) = { "oscclk", "sclk_isp_spi0_cam1", };
  4725. PNAME(mout_aclk_cam1_333_user_p) = { "oscclk", "aclk_cam1_333", };
  4726. PNAME(mout_aclk_cam1_400_user_p) = { "oscclk", "aclk_cam1_400", };
  4727. PNAME(mout_aclk_cam1_552_user_p) = { "oscclk", "aclk_cam1_552", };
  4728. PNAME(mout_phyclk_rxbyteclkhs0_s2b_user_p) = { "oscclk",
  4729. "phyclk_rxbyteclkhs0_s2b_phy", };
  4730. PNAME(mout_aclk_csis2_b_p) = { "mout_aclk_csis2_a",
  4731. "mout_aclk_cam1_333_user", };
  4732. PNAME(mout_aclk_csis2_a_p) = { "mout_aclk_cam1_552_user",
  4733. "mout_aclk_cam1_400_user", };
  4734. PNAME(mout_aclk_fd_b_p) = { "mout_aclk_fd_a",
  4735. "mout_aclk_cam1_333_user", };
  4736. PNAME(mout_aclk_fd_a_p) = { "mout_aclk_cam1_552_user",
  4737. "mout_aclk_cam1_400_user", };
  4738. PNAME(mout_aclk_lite_c_b_p) = { "mout_aclk_lite_c_a",
  4739. "mout_aclk_cam1_333_user", };
  4740. PNAME(mout_aclk_lite_c_a_p) = { "mout_aclk_cam1_552_user",
  4741. "mout_aclk_cam1_400_user", };
  4742. static const struct samsung_fixed_rate_clock cam1_fixed_clks[] __initconst = {
  4743. FRATE(CLK_PHYCLK_RXBYTEECLKHS0_S2B, "phyclk_rxbyteclkhs0_s2b_phy", NULL,
  4744. 0, 100000000),
  4745. };
  4746. static const struct samsung_mux_clock cam1_mux_clks[] __initconst = {
  4747. /* MUX_SEL_CAM10 */
  4748. MUX(CLK_MOUT_SCLK_ISP_UART_USER, "mout_sclk_isp_uart_user",
  4749. mout_sclk_isp_uart_user_p, MUX_SEL_CAM10, 20, 1),
  4750. MUX(CLK_MOUT_SCLK_ISP_SPI1_USER, "mout_sclk_isp_spi1_user",
  4751. mout_sclk_isp_spi1_user_p, MUX_SEL_CAM10, 16, 1),
  4752. MUX(CLK_MOUT_SCLK_ISP_SPI0_USER, "mout_sclk_isp_spi0_user",
  4753. mout_sclk_isp_spi0_user_p, MUX_SEL_CAM10, 12, 1),
  4754. MUX(CLK_MOUT_ACLK_CAM1_333_USER, "mout_aclk_cam1_333_user",
  4755. mout_aclk_cam1_333_user_p, MUX_SEL_CAM10, 8, 1),
  4756. MUX(CLK_MOUT_ACLK_CAM1_400_USER, "mout_aclk_cam1_400_user",
  4757. mout_aclk_cam1_400_user_p, MUX_SEL_CAM10, 4, 1),
  4758. MUX(CLK_MOUT_ACLK_CAM1_552_USER, "mout_aclk_cam1_552_user",
  4759. mout_aclk_cam1_552_user_p, MUX_SEL_CAM10, 0, 1),
  4760. /* MUX_SEL_CAM11 */
  4761. MUX(CLK_MOUT_PHYCLK_RXBYTECLKHS0_S2B_USER,
  4762. "mout_phyclk_rxbyteclkhs0_s2b_user",
  4763. mout_phyclk_rxbyteclkhs0_s2b_user_p,
  4764. MUX_SEL_CAM11, 0, 1),
  4765. /* MUX_SEL_CAM12 */
  4766. MUX(CLK_MOUT_ACLK_CSIS2_B, "mout_aclk_csis2_b", mout_aclk_csis2_b_p,
  4767. MUX_SEL_CAM12, 20, 1),
  4768. MUX(CLK_MOUT_ACLK_CSIS2_A, "mout_aclk_csis2_a", mout_aclk_csis2_a_p,
  4769. MUX_SEL_CAM12, 16, 1),
  4770. MUX(CLK_MOUT_ACLK_FD_B, "mout_aclk_fd_b", mout_aclk_fd_b_p,
  4771. MUX_SEL_CAM12, 12, 1),
  4772. MUX(CLK_MOUT_ACLK_FD_A, "mout_aclk_fd_a", mout_aclk_fd_a_p,
  4773. MUX_SEL_CAM12, 8, 1),
  4774. MUX(CLK_MOUT_ACLK_LITE_C_B, "mout_aclk_lite_c_b", mout_aclk_lite_c_b_p,
  4775. MUX_SEL_CAM12, 4, 1),
  4776. MUX(CLK_MOUT_ACLK_LITE_C_A, "mout_aclk_lite_c_a", mout_aclk_lite_c_a_p,
  4777. MUX_SEL_CAM12, 0, 1),
  4778. };
  4779. static const struct samsung_div_clock cam1_div_clks[] __initconst = {
  4780. /* DIV_CAM10 */
  4781. DIV(CLK_DIV_SCLK_ISP_MPWM, "div_sclk_isp_mpwm",
  4782. "div_pclk_cam1_83", DIV_CAM10, 16, 2),
  4783. DIV(CLK_DIV_PCLK_CAM1_83, "div_pclk_cam1_83",
  4784. "mout_aclk_cam1_333_user", DIV_CAM10, 12, 2),
  4785. DIV(CLK_DIV_PCLK_CAM1_166, "div_pclk_cam1_166",
  4786. "mout_aclk_cam1_333_user", DIV_CAM10, 8, 2),
  4787. DIV(CLK_DIV_PCLK_DBG_CAM1, "div_pclk_dbg_cam1",
  4788. "mout_aclk_cam1_552_user", DIV_CAM10, 4, 3),
  4789. DIV(CLK_DIV_ATCLK_CAM1, "div_atclk_cam1", "mout_aclk_cam1_552_user",
  4790. DIV_CAM10, 0, 3),
  4791. /* DIV_CAM11 */
  4792. DIV(CLK_DIV_ACLK_CSIS2, "div_aclk_csis2", "mout_aclk_csis2_b",
  4793. DIV_CAM11, 16, 3),
  4794. DIV(CLK_DIV_PCLK_FD, "div_pclk_fd", "div_aclk_fd", DIV_CAM11, 12, 2),
  4795. DIV(CLK_DIV_ACLK_FD, "div_aclk_fd", "mout_aclk_fd_b", DIV_CAM11, 8, 3),
  4796. DIV(CLK_DIV_PCLK_LITE_C, "div_pclk_lite_c", "div_aclk_lite_c",
  4797. DIV_CAM11, 4, 2),
  4798. DIV(CLK_DIV_ACLK_LITE_C, "div_aclk_lite_c", "mout_aclk_lite_c_b",
  4799. DIV_CAM11, 0, 3),
  4800. };
  4801. static const struct samsung_gate_clock cam1_gate_clks[] __initconst = {
  4802. /* ENABLE_ACLK_CAM10 */
  4803. GATE(CLK_ACLK_ISP_GIC, "aclk_isp_gic", "mout_aclk_cam1_333_user",
  4804. ENABLE_ACLK_CAM10, 4, 0, 0),
  4805. GATE(CLK_ACLK_FD, "aclk_fd", "div_aclk_fd",
  4806. ENABLE_ACLK_CAM10, 3, 0, 0),
  4807. GATE(CLK_ACLK_LITE_C, "aclk_lite_c", "div_aclk_lite_c",
  4808. ENABLE_ACLK_CAM10, 1, 0, 0),
  4809. GATE(CLK_ACLK_CSIS2, "aclk_csis2", "div_aclk_csis2",
  4810. ENABLE_ACLK_CAM10, 0, 0, 0),
  4811. /* ENABLE_ACLK_CAM11 */
  4812. GATE(CLK_ACLK_ASYNCAPBM_FD, "aclk_asyncapbm_fd", "div_pclk_fd",
  4813. ENABLE_ACLK_CAM11, 29, CLK_IGNORE_UNUSED, 0),
  4814. GATE(CLK_ACLK_ASYNCAPBS_FD, "aclk_asyncapbs_fd", "div_pclk_cam1_166",
  4815. ENABLE_ACLK_CAM11, 28, CLK_IGNORE_UNUSED, 0),
  4816. GATE(CLK_ACLK_ASYNCAPBM_LITE_C, "aclk_asyncapbm_lite_c",
  4817. "div_pclk_lite_c", ENABLE_ACLK_CAM11,
  4818. 27, CLK_IGNORE_UNUSED, 0),
  4819. GATE(CLK_ACLK_ASYNCAPBS_LITE_C, "aclk_asyncapbs_lite_c",
  4820. "div_pclk_cam1_166", ENABLE_ACLK_CAM11,
  4821. 26, CLK_IGNORE_UNUSED, 0),
  4822. GATE(CLK_ACLK_ASYNCAHBS_SFRISP2H2, "aclk_asyncahbs_sfrisp2h2",
  4823. "div_pclk_cam1_83", ENABLE_ACLK_CAM11,
  4824. 25, CLK_IGNORE_UNUSED, 0),
  4825. GATE(CLK_ACLK_ASYNCAHBS_SFRISP2H1, "aclk_asyncahbs_sfrisp2h1",
  4826. "div_pclk_cam1_83", ENABLE_ACLK_CAM11,
  4827. 24, CLK_IGNORE_UNUSED, 0),
  4828. GATE(CLK_ACLK_ASYNCAXIM_CA5, "aclk_asyncaxim_ca5",
  4829. "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
  4830. 23, CLK_IGNORE_UNUSED, 0),
  4831. GATE(CLK_ACLK_ASYNCAXIS_CA5, "aclk_asyncaxis_ca5",
  4832. "mout_aclk_cam1_552_user", ENABLE_ACLK_CAM11,
  4833. 22, CLK_IGNORE_UNUSED, 0),
  4834. GATE(CLK_ACLK_ASYNCAXIS_ISPX2, "aclk_asyncaxis_ispx2",
  4835. "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
  4836. 21, CLK_IGNORE_UNUSED, 0),
  4837. GATE(CLK_ACLK_ASYNCAXIS_ISPX1, "aclk_asyncaxis_ispx1",
  4838. "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
  4839. 20, CLK_IGNORE_UNUSED, 0),
  4840. GATE(CLK_ACLK_ASYNCAXIS_ISPX0, "aclk_asyncaxis_ispx0",
  4841. "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
  4842. 19, CLK_IGNORE_UNUSED, 0),
  4843. GATE(CLK_ACLK_ASYNCAXIM_ISPEX, "aclk_asyncaxim_ispex",
  4844. "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM11,
  4845. 18, CLK_IGNORE_UNUSED, 0),
  4846. GATE(CLK_ACLK_ASYNCAXIM_ISP3P, "aclk_asyncaxim_isp3p",
  4847. "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM11,
  4848. 17, CLK_IGNORE_UNUSED, 0),
  4849. GATE(CLK_ACLK_ASYNCAXIS_ISP3P, "aclk_asyncaxis_isp3p",
  4850. "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
  4851. 16, CLK_IGNORE_UNUSED, 0),
  4852. GATE(CLK_ACLK_ASYNCAXIM_FD, "aclk_asyncaxim_fd",
  4853. "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM11,
  4854. 15, CLK_IGNORE_UNUSED, 0),
  4855. GATE(CLK_ACLK_ASYNCAXIS_FD, "aclk_asyncaxis_fd", "div_aclk_fd",
  4856. ENABLE_ACLK_CAM11, 14, CLK_IGNORE_UNUSED, 0),
  4857. GATE(CLK_ACLK_ASYNCAXIM_LITE_C, "aclk_asyncaxim_lite_c",
  4858. "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM11,
  4859. 13, CLK_IGNORE_UNUSED, 0),
  4860. GATE(CLK_ACLK_ASYNCAXIS_LITE_C, "aclk_asyncaxis_lite_c",
  4861. "div_aclk_lite_c", ENABLE_ACLK_CAM11,
  4862. 12, CLK_IGNORE_UNUSED, 0),
  4863. GATE(CLK_ACLK_AHB2APB_ISP5P, "aclk_ahb2apb_isp5p", "div_pclk_cam1_83",
  4864. ENABLE_ACLK_CAM11, 11, CLK_IGNORE_UNUSED, 0),
  4865. GATE(CLK_ACLK_AHB2APB_ISP3P, "aclk_ahb2apb_isp3p", "div_pclk_cam1_83",
  4866. ENABLE_ACLK_CAM11, 10, CLK_IGNORE_UNUSED, 0),
  4867. GATE(CLK_ACLK_AXI2APB_ISP3P, "aclk_axi2apb_isp3p",
  4868. "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
  4869. 9, CLK_IGNORE_UNUSED, 0),
  4870. GATE(CLK_ACLK_AHB_SFRISP2H, "aclk_ahb_sfrisp2h", "div_pclk_cam1_83",
  4871. ENABLE_ACLK_CAM11, 8, CLK_IGNORE_UNUSED, 0),
  4872. GATE(CLK_ACLK_AXI_ISP_HX_R, "aclk_axi_isp_hx_r", "div_pclk_cam1_166",
  4873. ENABLE_ACLK_CAM11, 7, CLK_IGNORE_UNUSED, 0),
  4874. GATE(CLK_ACLK_AXI_ISP_CX_R, "aclk_axi_isp_cx_r", "div_pclk_cam1_166",
  4875. ENABLE_ACLK_CAM11, 6, CLK_IGNORE_UNUSED, 0),
  4876. GATE(CLK_ACLK_AXI_ISP_HX, "aclk_axi_isp_hx", "mout_aclk_cam1_333_user",
  4877. ENABLE_ACLK_CAM11, 5, CLK_IGNORE_UNUSED, 0),
  4878. GATE(CLK_ACLK_AXI_ISP_CX, "aclk_axi_isp_cx", "mout_aclk_cam1_333_user",
  4879. ENABLE_ACLK_CAM11, 4, CLK_IGNORE_UNUSED, 0),
  4880. GATE(CLK_ACLK_XIU_ISPX, "aclk_xiu_ispx", "mout_aclk_cam1_333_user",
  4881. ENABLE_ACLK_CAM11, 3, CLK_IGNORE_UNUSED, 0),
  4882. GATE(CLK_ACLK_XIU_ISPEX, "aclk_xiu_ispex", "mout_aclk_cam1_400_user",
  4883. ENABLE_ACLK_CAM11, 2, CLK_IGNORE_UNUSED, 0),
  4884. GATE(CLK_ACLK_CAM1NP_333, "aclk_cam1np_333", "mout_aclk_cam1_333_user",
  4885. ENABLE_ACLK_CAM11, 1, CLK_IGNORE_UNUSED, 0),
  4886. GATE(CLK_ACLK_CAM1ND_400, "aclk_cam1nd_400", "mout_aclk_cam1_400_user",
  4887. ENABLE_ACLK_CAM11, 0, CLK_IGNORE_UNUSED, 0),
  4888. /* ENABLE_ACLK_CAM12 */
  4889. GATE(CLK_ACLK_SMMU_ISPCPU, "aclk_smmu_ispcpu",
  4890. "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM12,
  4891. 10, CLK_IGNORE_UNUSED, 0),
  4892. GATE(CLK_ACLK_SMMU_FD, "aclk_smmu_fd", "mout_aclk_cam1_400_user",
  4893. ENABLE_ACLK_CAM12, 9, CLK_IGNORE_UNUSED, 0),
  4894. GATE(CLK_ACLK_SMMU_LITE_C, "aclk_smmu_lite_c",
  4895. "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM12,
  4896. 8, CLK_IGNORE_UNUSED, 0),
  4897. GATE(CLK_ACLK_BTS_ISP3P, "aclk_bts_isp3p", "mout_aclk_cam1_400_user",
  4898. ENABLE_ACLK_CAM12, 7, CLK_IGNORE_UNUSED, 0),
  4899. GATE(CLK_ACLK_BTS_FD, "aclk_bts_fd", "mout_aclk_cam1_400_user",
  4900. ENABLE_ACLK_CAM12, 6, CLK_IGNORE_UNUSED, 0),
  4901. GATE(CLK_ACLK_BTS_LITE_C, "aclk_bts_lite_c", "mout_aclk_cam1_400_user",
  4902. ENABLE_ACLK_CAM12, 5, CLK_IGNORE_UNUSED, 0),
  4903. GATE(CLK_ACLK_AHBDN_SFRISP2H, "aclk_ahbdn_sfrisp2h",
  4904. "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM12,
  4905. 4, CLK_IGNORE_UNUSED, 0),
  4906. GATE(CLK_ACLK_AHBDN_ISP5P, "aclk_aclk-shbdn_isp5p",
  4907. "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM12,
  4908. 3, CLK_IGNORE_UNUSED, 0),
  4909. GATE(CLK_ACLK_AXIUS_ISP3P, "aclk_axius_isp3p",
  4910. "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM12,
  4911. 2, CLK_IGNORE_UNUSED, 0),
  4912. GATE(CLK_ACLK_AXIUS_FD, "aclk_axius_fd", "mout_aclk_cam1_400_user",
  4913. ENABLE_ACLK_CAM12, 1, CLK_IGNORE_UNUSED, 0),
  4914. GATE(CLK_ACLK_AXIUS_LITE_C, "aclk_axius_lite_c",
  4915. "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM12,
  4916. 0, CLK_IGNORE_UNUSED, 0),
  4917. /* ENABLE_PCLK_CAM1 */
  4918. GATE(CLK_PCLK_SMMU_ISPCPU, "pclk_smmu_ispcpu", "div_pclk_cam1_166",
  4919. ENABLE_PCLK_CAM1, 27, CLK_IGNORE_UNUSED, 0),
  4920. GATE(CLK_PCLK_SMMU_FD, "pclk_smmu_fd", "div_pclk_cam1_166",
  4921. ENABLE_PCLK_CAM1, 26, CLK_IGNORE_UNUSED, 0),
  4922. GATE(CLK_PCLK_SMMU_LITE_C, "pclk_smmu_lite_c", "div_pclk_cam1_166",
  4923. ENABLE_PCLK_CAM1, 25, CLK_IGNORE_UNUSED, 0),
  4924. GATE(CLK_PCLK_BTS_ISP3P, "pclk_bts_isp3p", "div_pclk_cam1_83",
  4925. ENABLE_PCLK_CAM1, 24, CLK_IGNORE_UNUSED, 0),
  4926. GATE(CLK_PCLK_BTS_FD, "pclk_bts_fd", "div_pclk_cam1_83",
  4927. ENABLE_PCLK_CAM1, 23, CLK_IGNORE_UNUSED, 0),
  4928. GATE(CLK_PCLK_BTS_LITE_C, "pclk_bts_lite_c", "div_pclk_cam1_83",
  4929. ENABLE_PCLK_CAM1, 22, CLK_IGNORE_UNUSED, 0),
  4930. GATE(CLK_PCLK_ASYNCAXIM_CA5, "pclk_asyncaxim_ca5", "div_pclk_cam1_166",
  4931. ENABLE_PCLK_CAM1, 21, CLK_IGNORE_UNUSED, 0),
  4932. GATE(CLK_PCLK_ASYNCAXIM_ISPEX, "pclk_asyncaxim_ispex",
  4933. "div_pclk_cam1_83", ENABLE_PCLK_CAM1,
  4934. 20, CLK_IGNORE_UNUSED, 0),
  4935. GATE(CLK_PCLK_ASYNCAXIM_ISP3P, "pclk_asyncaxim_isp3p",
  4936. "div_pclk_cam1_83", ENABLE_PCLK_CAM1,
  4937. 19, CLK_IGNORE_UNUSED, 0),
  4938. GATE(CLK_PCLK_ASYNCAXIM_FD, "pclk_asyncaxim_fd", "div_pclk_cam1_83",
  4939. ENABLE_PCLK_CAM1, 18, CLK_IGNORE_UNUSED, 0),
  4940. GATE(CLK_PCLK_ASYNCAXIM_LITE_C, "pclk_asyncaxim_lite_c",
  4941. "div_pclk_cam1_83", ENABLE_PCLK_CAM1,
  4942. 17, CLK_IGNORE_UNUSED, 0),
  4943. GATE(CLK_PCLK_PMU_CAM1, "pclk_pmu_cam1", "div_pclk_cam1_83",
  4944. ENABLE_PCLK_CAM1, 16, CLK_IGNORE_UNUSED, 0),
  4945. GATE(CLK_PCLK_SYSREG_CAM1, "pclk_sysreg_cam1", "div_pclk_cam1_83",
  4946. ENABLE_PCLK_CAM1, 15, CLK_IGNORE_UNUSED, 0),
  4947. GATE(CLK_PCLK_CMU_CAM1_LOCAL, "pclk_cmu_cam1_local",
  4948. "div_pclk_cam1_166", ENABLE_PCLK_CAM1,
  4949. 14, CLK_IGNORE_UNUSED, 0),
  4950. GATE(CLK_PCLK_ISP_MCTADC, "pclk_isp_mctadc", "div_pclk_cam1_83",
  4951. ENABLE_PCLK_CAM1, 13, CLK_IGNORE_UNUSED, 0),
  4952. GATE(CLK_PCLK_ISP_WDT, "pclk_isp_wdt", "div_pclk_cam1_83",
  4953. ENABLE_PCLK_CAM1, 12, CLK_IGNORE_UNUSED, 0),
  4954. GATE(CLK_PCLK_ISP_PWM, "pclk_isp_pwm", "div_pclk_cam1_83",
  4955. ENABLE_PCLK_CAM1, 11, CLK_IGNORE_UNUSED, 0),
  4956. GATE(CLK_PCLK_ISP_UART, "pclk_isp_uart", "div_pclk_cam1_83",
  4957. ENABLE_PCLK_CAM1, 10, CLK_IGNORE_UNUSED, 0),
  4958. GATE(CLK_PCLK_ISP_MCUCTL, "pclk_isp_mcuctl", "div_pclk_cam1_83",
  4959. ENABLE_PCLK_CAM1, 9, CLK_IGNORE_UNUSED, 0),
  4960. GATE(CLK_PCLK_ISP_SPI1, "pclk_isp_spi1", "div_pclk_cam1_83",
  4961. ENABLE_PCLK_CAM1, 8, CLK_IGNORE_UNUSED, 0),
  4962. GATE(CLK_PCLK_ISP_SPI0, "pclk_isp_spi0", "div_pclk_cam1_83",
  4963. ENABLE_PCLK_CAM1, 7, CLK_IGNORE_UNUSED, 0),
  4964. GATE(CLK_PCLK_ISP_I2C2, "pclk_isp_i2c2", "div_pclk_cam1_83",
  4965. ENABLE_PCLK_CAM1, 6, CLK_IGNORE_UNUSED, 0),
  4966. GATE(CLK_PCLK_ISP_I2C1, "pclk_isp_i2c1", "div_pclk_cam1_83",
  4967. ENABLE_PCLK_CAM1, 5, CLK_IGNORE_UNUSED, 0),
  4968. GATE(CLK_PCLK_ISP_I2C0, "pclk_isp_i2c0", "div_pclk_cam1_83",
  4969. ENABLE_PCLK_CAM1, 4, CLK_IGNORE_UNUSED, 0),
  4970. GATE(CLK_PCLK_ISP_MPWM, "pclk_isp_mpwm", "div_pclk_cam1_83",
  4971. ENABLE_PCLK_CAM1, 3, CLK_IGNORE_UNUSED, 0),
  4972. GATE(CLK_PCLK_FD, "pclk_fd", "div_pclk_fd",
  4973. ENABLE_PCLK_CAM1, 3, CLK_IGNORE_UNUSED, 0),
  4974. GATE(CLK_PCLK_LITE_C, "pclk_lite_c", "div_pclk_lite_c",
  4975. ENABLE_PCLK_CAM1, 1, CLK_IGNORE_UNUSED, 0),
  4976. GATE(CLK_PCLK_CSIS2, "pclk_csis2", "div_pclk_cam1_166",
  4977. ENABLE_PCLK_CAM1, 0, CLK_IGNORE_UNUSED, 0),
  4978. /* ENABLE_SCLK_CAM1 */
  4979. GATE(CLK_SCLK_ISP_I2C2, "sclk_isp_i2c2", "oscclk", ENABLE_SCLK_CAM1,
  4980. 15, 0, 0),
  4981. GATE(CLK_SCLK_ISP_I2C1, "sclk_isp_i2c1", "oscclk", ENABLE_SCLK_CAM1,
  4982. 14, 0, 0),
  4983. GATE(CLK_SCLK_ISP_I2C0, "sclk_isp_i2c0", "oscclk", ENABLE_SCLK_CAM1,
  4984. 13, 0, 0),
  4985. GATE(CLK_SCLK_ISP_PWM, "sclk_isp_pwm", "oscclk", ENABLE_SCLK_CAM1,
  4986. 12, 0, 0),
  4987. GATE(CLK_PHYCLK_RXBYTECLKHS0_S2B, "phyclk_rxbyteclkhs0_s2b",
  4988. "mout_phyclk_rxbyteclkhs0_s2b_user",
  4989. ENABLE_SCLK_CAM1, 11, 0, 0),
  4990. GATE(CLK_SCLK_LITE_C_FREECNT, "sclk_lite_c_freecnt", "div_pclk_lite_c",
  4991. ENABLE_SCLK_CAM1, 10, 0, 0),
  4992. GATE(CLK_SCLK_PIXELASYNCM_FD, "sclk_pixelasyncm_fd", "div_aclk_fd",
  4993. ENABLE_SCLK_CAM1, 9, 0, 0),
  4994. GATE(CLK_SCLK_ISP_MCTADC, "sclk_isp_mctadc", "sclk_isp_mctadc_cam1",
  4995. ENABLE_SCLK_CAM1, 7, 0, 0),
  4996. GATE(CLK_SCLK_ISP_UART, "sclk_isp_uart", "mout_sclk_isp_uart_user",
  4997. ENABLE_SCLK_CAM1, 6, 0, 0),
  4998. GATE(CLK_SCLK_ISP_SPI1, "sclk_isp_spi1", "mout_sclk_isp_spi1_user",
  4999. ENABLE_SCLK_CAM1, 5, 0, 0),
  5000. GATE(CLK_SCLK_ISP_SPI0, "sclk_isp_spi0", "mout_sclk_isp_spi0_user",
  5001. ENABLE_SCLK_CAM1, 4, 0, 0),
  5002. GATE(CLK_SCLK_ISP_MPWM, "sclk_isp_mpwm", "div_sclk_isp_mpwm",
  5003. ENABLE_SCLK_CAM1, 3, 0, 0),
  5004. GATE(CLK_PCLK_DBG_ISP, "sclk_dbg_isp", "div_pclk_dbg_cam1",
  5005. ENABLE_SCLK_CAM1, 2, 0, 0),
  5006. GATE(CLK_ATCLK_ISP, "atclk_isp", "div_atclk_cam1",
  5007. ENABLE_SCLK_CAM1, 1, 0, 0),
  5008. GATE(CLK_SCLK_ISP_CA5, "sclk_isp_ca5", "mout_aclk_cam1_552_user",
  5009. ENABLE_SCLK_CAM1, 0, 0, 0),
  5010. };
  5011. static const struct samsung_cmu_info cam1_cmu_info __initconst = {
  5012. .mux_clks = cam1_mux_clks,
  5013. .nr_mux_clks = ARRAY_SIZE(cam1_mux_clks),
  5014. .div_clks = cam1_div_clks,
  5015. .nr_div_clks = ARRAY_SIZE(cam1_div_clks),
  5016. .gate_clks = cam1_gate_clks,
  5017. .nr_gate_clks = ARRAY_SIZE(cam1_gate_clks),
  5018. .fixed_clks = cam1_fixed_clks,
  5019. .nr_fixed_clks = ARRAY_SIZE(cam1_fixed_clks),
  5020. .nr_clk_ids = CAM1_NR_CLK,
  5021. .clk_regs = cam1_clk_regs,
  5022. .nr_clk_regs = ARRAY_SIZE(cam1_clk_regs),
  5023. };
  5024. static void __init exynos5433_cmu_cam1_init(struct device_node *np)
  5025. {
  5026. samsung_cmu_register_one(np, &cam1_cmu_info);
  5027. }
  5028. CLK_OF_DECLARE(exynos5433_cmu_cam1, "samsung,exynos5433-cmu-cam1",
  5029. exynos5433_cmu_cam1_init);