pinctrl-spear1310.c 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736
  1. /*
  2. * Driver for the ST Microelectronics SPEAr1310 pinmux
  3. *
  4. * Copyright (C) 2012 ST Microelectronics
  5. * Viresh Kumar <vireshk@kernel.org>
  6. *
  7. * This file is licensed under the terms of the GNU General Public
  8. * License version 2. This program is licensed "as is" without any
  9. * warranty of any kind, whether express or implied.
  10. */
  11. #include <linux/err.h>
  12. #include <linux/init.h>
  13. #include <linux/module.h>
  14. #include <linux/of_device.h>
  15. #include <linux/platform_device.h>
  16. #include "pinctrl-spear.h"
  17. #define DRIVER_NAME "spear1310-pinmux"
  18. /* pins */
  19. static const struct pinctrl_pin_desc spear1310_pins[] = {
  20. SPEAR_PIN_0_TO_101,
  21. SPEAR_PIN_102_TO_245,
  22. };
  23. /* registers */
  24. #define PERIP_CFG 0x3B0
  25. #define MCIF_SEL_SHIFT 5
  26. #define MCIF_SEL_SD (0x1 << MCIF_SEL_SHIFT)
  27. #define MCIF_SEL_CF (0x2 << MCIF_SEL_SHIFT)
  28. #define MCIF_SEL_XD (0x3 << MCIF_SEL_SHIFT)
  29. #define MCIF_SEL_MASK (0x3 << MCIF_SEL_SHIFT)
  30. #define PCIE_SATA_CFG 0x3A4
  31. #define PCIE_SATA2_SEL_PCIE (0 << 31)
  32. #define PCIE_SATA1_SEL_PCIE (0 << 30)
  33. #define PCIE_SATA0_SEL_PCIE (0 << 29)
  34. #define PCIE_SATA2_SEL_SATA (1 << 31)
  35. #define PCIE_SATA1_SEL_SATA (1 << 30)
  36. #define PCIE_SATA0_SEL_SATA (1 << 29)
  37. #define SATA2_CFG_TX_CLK_EN (1 << 27)
  38. #define SATA2_CFG_RX_CLK_EN (1 << 26)
  39. #define SATA2_CFG_POWERUP_RESET (1 << 25)
  40. #define SATA2_CFG_PM_CLK_EN (1 << 24)
  41. #define SATA1_CFG_TX_CLK_EN (1 << 23)
  42. #define SATA1_CFG_RX_CLK_EN (1 << 22)
  43. #define SATA1_CFG_POWERUP_RESET (1 << 21)
  44. #define SATA1_CFG_PM_CLK_EN (1 << 20)
  45. #define SATA0_CFG_TX_CLK_EN (1 << 19)
  46. #define SATA0_CFG_RX_CLK_EN (1 << 18)
  47. #define SATA0_CFG_POWERUP_RESET (1 << 17)
  48. #define SATA0_CFG_PM_CLK_EN (1 << 16)
  49. #define PCIE2_CFG_DEVICE_PRESENT (1 << 11)
  50. #define PCIE2_CFG_POWERUP_RESET (1 << 10)
  51. #define PCIE2_CFG_CORE_CLK_EN (1 << 9)
  52. #define PCIE2_CFG_AUX_CLK_EN (1 << 8)
  53. #define PCIE1_CFG_DEVICE_PRESENT (1 << 7)
  54. #define PCIE1_CFG_POWERUP_RESET (1 << 6)
  55. #define PCIE1_CFG_CORE_CLK_EN (1 << 5)
  56. #define PCIE1_CFG_AUX_CLK_EN (1 << 4)
  57. #define PCIE0_CFG_DEVICE_PRESENT (1 << 3)
  58. #define PCIE0_CFG_POWERUP_RESET (1 << 2)
  59. #define PCIE0_CFG_CORE_CLK_EN (1 << 1)
  60. #define PCIE0_CFG_AUX_CLK_EN (1 << 0)
  61. #define PAD_FUNCTION_EN_0 0x650
  62. #define PMX_UART0_MASK (1 << 1)
  63. #define PMX_I2C0_MASK (1 << 2)
  64. #define PMX_I2S0_MASK (1 << 3)
  65. #define PMX_SSP0_MASK (1 << 4)
  66. #define PMX_CLCD1_MASK (1 << 5)
  67. #define PMX_EGPIO00_MASK (1 << 6)
  68. #define PMX_EGPIO01_MASK (1 << 7)
  69. #define PMX_EGPIO02_MASK (1 << 8)
  70. #define PMX_EGPIO03_MASK (1 << 9)
  71. #define PMX_EGPIO04_MASK (1 << 10)
  72. #define PMX_EGPIO05_MASK (1 << 11)
  73. #define PMX_EGPIO06_MASK (1 << 12)
  74. #define PMX_EGPIO07_MASK (1 << 13)
  75. #define PMX_EGPIO08_MASK (1 << 14)
  76. #define PMX_EGPIO09_MASK (1 << 15)
  77. #define PMX_SMI_MASK (1 << 16)
  78. #define PMX_NAND8_MASK (1 << 17)
  79. #define PMX_GMIICLK_MASK (1 << 18)
  80. #define PMX_GMIICOL_CRS_XFERER_MIITXCLK_MASK (1 << 19)
  81. #define PMX_RXCLK_RDV_TXEN_D03_MASK (1 << 20)
  82. #define PMX_GMIID47_MASK (1 << 21)
  83. #define PMX_MDC_MDIO_MASK (1 << 22)
  84. #define PMX_MCI_DATA8_15_MASK (1 << 23)
  85. #define PMX_NFAD23_MASK (1 << 24)
  86. #define PMX_NFAD24_MASK (1 << 25)
  87. #define PMX_NFAD25_MASK (1 << 26)
  88. #define PMX_NFCE3_MASK (1 << 27)
  89. #define PMX_NFWPRT3_MASK (1 << 28)
  90. #define PMX_NFRSTPWDWN0_MASK (1 << 29)
  91. #define PMX_NFRSTPWDWN1_MASK (1 << 30)
  92. #define PMX_NFRSTPWDWN2_MASK (1 << 31)
  93. #define PAD_FUNCTION_EN_1 0x654
  94. #define PMX_NFRSTPWDWN3_MASK (1 << 0)
  95. #define PMX_SMINCS2_MASK (1 << 1)
  96. #define PMX_SMINCS3_MASK (1 << 2)
  97. #define PMX_CLCD2_MASK (1 << 3)
  98. #define PMX_KBD_ROWCOL68_MASK (1 << 4)
  99. #define PMX_EGPIO10_MASK (1 << 5)
  100. #define PMX_EGPIO11_MASK (1 << 6)
  101. #define PMX_EGPIO12_MASK (1 << 7)
  102. #define PMX_EGPIO13_MASK (1 << 8)
  103. #define PMX_EGPIO14_MASK (1 << 9)
  104. #define PMX_EGPIO15_MASK (1 << 10)
  105. #define PMX_UART0_MODEM_MASK (1 << 11)
  106. #define PMX_GPT0_TMR0_MASK (1 << 12)
  107. #define PMX_GPT0_TMR1_MASK (1 << 13)
  108. #define PMX_GPT1_TMR0_MASK (1 << 14)
  109. #define PMX_GPT1_TMR1_MASK (1 << 15)
  110. #define PMX_I2S1_MASK (1 << 16)
  111. #define PMX_KBD_ROWCOL25_MASK (1 << 17)
  112. #define PMX_NFIO8_15_MASK (1 << 18)
  113. #define PMX_KBD_COL1_MASK (1 << 19)
  114. #define PMX_NFCE1_MASK (1 << 20)
  115. #define PMX_KBD_COL0_MASK (1 << 21)
  116. #define PMX_NFCE2_MASK (1 << 22)
  117. #define PMX_KBD_ROW1_MASK (1 << 23)
  118. #define PMX_NFWPRT1_MASK (1 << 24)
  119. #define PMX_KBD_ROW0_MASK (1 << 25)
  120. #define PMX_NFWPRT2_MASK (1 << 26)
  121. #define PMX_MCIDATA0_MASK (1 << 27)
  122. #define PMX_MCIDATA1_MASK (1 << 28)
  123. #define PMX_MCIDATA2_MASK (1 << 29)
  124. #define PMX_MCIDATA3_MASK (1 << 30)
  125. #define PMX_MCIDATA4_MASK (1 << 31)
  126. #define PAD_FUNCTION_EN_2 0x658
  127. #define PMX_MCIDATA5_MASK (1 << 0)
  128. #define PMX_MCIDATA6_MASK (1 << 1)
  129. #define PMX_MCIDATA7_MASK (1 << 2)
  130. #define PMX_MCIDATA1SD_MASK (1 << 3)
  131. #define PMX_MCIDATA2SD_MASK (1 << 4)
  132. #define PMX_MCIDATA3SD_MASK (1 << 5)
  133. #define PMX_MCIADDR0ALE_MASK (1 << 6)
  134. #define PMX_MCIADDR1CLECLK_MASK (1 << 7)
  135. #define PMX_MCIADDR2_MASK (1 << 8)
  136. #define PMX_MCICECF_MASK (1 << 9)
  137. #define PMX_MCICEXD_MASK (1 << 10)
  138. #define PMX_MCICESDMMC_MASK (1 << 11)
  139. #define PMX_MCICDCF1_MASK (1 << 12)
  140. #define PMX_MCICDCF2_MASK (1 << 13)
  141. #define PMX_MCICDXD_MASK (1 << 14)
  142. #define PMX_MCICDSDMMC_MASK (1 << 15)
  143. #define PMX_MCIDATADIR_MASK (1 << 16)
  144. #define PMX_MCIDMARQWP_MASK (1 << 17)
  145. #define PMX_MCIIORDRE_MASK (1 << 18)
  146. #define PMX_MCIIOWRWE_MASK (1 << 19)
  147. #define PMX_MCIRESETCF_MASK (1 << 20)
  148. #define PMX_MCICS0CE_MASK (1 << 21)
  149. #define PMX_MCICFINTR_MASK (1 << 22)
  150. #define PMX_MCIIORDY_MASK (1 << 23)
  151. #define PMX_MCICS1_MASK (1 << 24)
  152. #define PMX_MCIDMAACK_MASK (1 << 25)
  153. #define PMX_MCISDCMD_MASK (1 << 26)
  154. #define PMX_MCILEDS_MASK (1 << 27)
  155. #define PMX_TOUCH_XY_MASK (1 << 28)
  156. #define PMX_SSP0_CS0_MASK (1 << 29)
  157. #define PMX_SSP0_CS1_2_MASK (1 << 30)
  158. #define PAD_DIRECTION_SEL_0 0x65C
  159. #define PAD_DIRECTION_SEL_1 0x660
  160. #define PAD_DIRECTION_SEL_2 0x664
  161. /* combined macros */
  162. #define PMX_GMII_MASK (PMX_GMIICLK_MASK | \
  163. PMX_GMIICOL_CRS_XFERER_MIITXCLK_MASK | \
  164. PMX_RXCLK_RDV_TXEN_D03_MASK | \
  165. PMX_GMIID47_MASK | PMX_MDC_MDIO_MASK)
  166. #define PMX_EGPIO_0_GRP_MASK (PMX_EGPIO00_MASK | PMX_EGPIO01_MASK | \
  167. PMX_EGPIO02_MASK | \
  168. PMX_EGPIO03_MASK | PMX_EGPIO04_MASK | \
  169. PMX_EGPIO05_MASK | PMX_EGPIO06_MASK | \
  170. PMX_EGPIO07_MASK | PMX_EGPIO08_MASK | \
  171. PMX_EGPIO09_MASK)
  172. #define PMX_EGPIO_1_GRP_MASK (PMX_EGPIO10_MASK | PMX_EGPIO11_MASK | \
  173. PMX_EGPIO12_MASK | PMX_EGPIO13_MASK | \
  174. PMX_EGPIO14_MASK | PMX_EGPIO15_MASK)
  175. #define PMX_KEYBOARD_6X6_MASK (PMX_KBD_ROW0_MASK | PMX_KBD_ROW1_MASK | \
  176. PMX_KBD_ROWCOL25_MASK | PMX_KBD_COL0_MASK | \
  177. PMX_KBD_COL1_MASK)
  178. #define PMX_NAND8BIT_0_MASK (PMX_NAND8_MASK | PMX_NFAD23_MASK | \
  179. PMX_NFAD24_MASK | PMX_NFAD25_MASK | \
  180. PMX_NFWPRT3_MASK | PMX_NFRSTPWDWN0_MASK | \
  181. PMX_NFRSTPWDWN1_MASK | PMX_NFRSTPWDWN2_MASK | \
  182. PMX_NFCE3_MASK)
  183. #define PMX_NAND8BIT_1_MASK PMX_NFRSTPWDWN3_MASK
  184. #define PMX_NAND16BIT_1_MASK (PMX_KBD_ROWCOL25_MASK | PMX_NFIO8_15_MASK)
  185. #define PMX_NAND_4CHIPS_MASK (PMX_NFCE1_MASK | PMX_NFCE2_MASK | \
  186. PMX_NFWPRT1_MASK | PMX_NFWPRT2_MASK | \
  187. PMX_KBD_ROW0_MASK | PMX_KBD_ROW1_MASK | \
  188. PMX_KBD_COL0_MASK | PMX_KBD_COL1_MASK)
  189. #define PMX_MCIFALL_1_MASK 0xF8000000
  190. #define PMX_MCIFALL_2_MASK 0x0FFFFFFF
  191. #define PMX_PCI_REG1_MASK (PMX_SMINCS2_MASK | PMX_SMINCS3_MASK | \
  192. PMX_CLCD2_MASK | PMX_KBD_ROWCOL68_MASK | \
  193. PMX_EGPIO_1_GRP_MASK | PMX_GPT0_TMR0_MASK | \
  194. PMX_GPT0_TMR1_MASK | PMX_GPT1_TMR0_MASK | \
  195. PMX_GPT1_TMR1_MASK | PMX_I2S1_MASK | \
  196. PMX_NFCE2_MASK)
  197. #define PMX_PCI_REG2_MASK (PMX_TOUCH_XY_MASK | PMX_SSP0_CS0_MASK | \
  198. PMX_SSP0_CS1_2_MASK)
  199. #define PMX_SMII_0_1_2_MASK (PMX_CLCD2_MASK | PMX_KBD_ROWCOL68_MASK)
  200. #define PMX_RGMII_REG0_MASK (PMX_MCI_DATA8_15_MASK | \
  201. PMX_GMIICOL_CRS_XFERER_MIITXCLK_MASK | \
  202. PMX_GMIID47_MASK)
  203. #define PMX_RGMII_REG1_MASK (PMX_KBD_ROWCOL68_MASK | PMX_EGPIO_1_GRP_MASK |\
  204. PMX_KBD_ROW1_MASK | PMX_NFWPRT1_MASK | \
  205. PMX_KBD_ROW0_MASK | PMX_NFWPRT2_MASK)
  206. #define PMX_RGMII_REG2_MASK (PMX_TOUCH_XY_MASK | PMX_SSP0_CS0_MASK | \
  207. PMX_SSP0_CS1_2_MASK)
  208. #define PCIE_CFG_VAL(x) (PCIE_SATA##x##_SEL_PCIE | \
  209. PCIE##x##_CFG_AUX_CLK_EN | \
  210. PCIE##x##_CFG_CORE_CLK_EN | \
  211. PCIE##x##_CFG_POWERUP_RESET | \
  212. PCIE##x##_CFG_DEVICE_PRESENT)
  213. #define SATA_CFG_VAL(x) (PCIE_SATA##x##_SEL_SATA | \
  214. SATA##x##_CFG_PM_CLK_EN | \
  215. SATA##x##_CFG_POWERUP_RESET | \
  216. SATA##x##_CFG_RX_CLK_EN | \
  217. SATA##x##_CFG_TX_CLK_EN)
  218. /* Pad multiplexing for i2c0 device */
  219. static const unsigned i2c0_pins[] = { 102, 103 };
  220. static struct spear_muxreg i2c0_muxreg[] = {
  221. {
  222. .reg = PAD_FUNCTION_EN_0,
  223. .mask = PMX_I2C0_MASK,
  224. .val = PMX_I2C0_MASK,
  225. }, {
  226. .reg = PAD_DIRECTION_SEL_0,
  227. .mask = PMX_I2C0_MASK,
  228. .val = PMX_I2C0_MASK,
  229. },
  230. };
  231. static struct spear_modemux i2c0_modemux[] = {
  232. {
  233. .muxregs = i2c0_muxreg,
  234. .nmuxregs = ARRAY_SIZE(i2c0_muxreg),
  235. },
  236. };
  237. static struct spear_pingroup i2c0_pingroup = {
  238. .name = "i2c0_grp",
  239. .pins = i2c0_pins,
  240. .npins = ARRAY_SIZE(i2c0_pins),
  241. .modemuxs = i2c0_modemux,
  242. .nmodemuxs = ARRAY_SIZE(i2c0_modemux),
  243. };
  244. static const char *const i2c0_grps[] = { "i2c0_grp" };
  245. static struct spear_function i2c0_function = {
  246. .name = "i2c0",
  247. .groups = i2c0_grps,
  248. .ngroups = ARRAY_SIZE(i2c0_grps),
  249. };
  250. /* Pad multiplexing for ssp0 device */
  251. static const unsigned ssp0_pins[] = { 109, 110, 111, 112 };
  252. static struct spear_muxreg ssp0_muxreg[] = {
  253. {
  254. .reg = PAD_FUNCTION_EN_0,
  255. .mask = PMX_SSP0_MASK,
  256. .val = PMX_SSP0_MASK,
  257. }, {
  258. .reg = PAD_DIRECTION_SEL_0,
  259. .mask = PMX_SSP0_MASK,
  260. .val = PMX_SSP0_MASK,
  261. },
  262. };
  263. static struct spear_modemux ssp0_modemux[] = {
  264. {
  265. .muxregs = ssp0_muxreg,
  266. .nmuxregs = ARRAY_SIZE(ssp0_muxreg),
  267. },
  268. };
  269. static struct spear_pingroup ssp0_pingroup = {
  270. .name = "ssp0_grp",
  271. .pins = ssp0_pins,
  272. .npins = ARRAY_SIZE(ssp0_pins),
  273. .modemuxs = ssp0_modemux,
  274. .nmodemuxs = ARRAY_SIZE(ssp0_modemux),
  275. };
  276. /* Pad multiplexing for ssp0_cs0 device */
  277. static const unsigned ssp0_cs0_pins[] = { 96 };
  278. static struct spear_muxreg ssp0_cs0_muxreg[] = {
  279. {
  280. .reg = PAD_FUNCTION_EN_2,
  281. .mask = PMX_SSP0_CS0_MASK,
  282. .val = PMX_SSP0_CS0_MASK,
  283. }, {
  284. .reg = PAD_DIRECTION_SEL_2,
  285. .mask = PMX_SSP0_CS0_MASK,
  286. .val = PMX_SSP0_CS0_MASK,
  287. },
  288. };
  289. static struct spear_modemux ssp0_cs0_modemux[] = {
  290. {
  291. .muxregs = ssp0_cs0_muxreg,
  292. .nmuxregs = ARRAY_SIZE(ssp0_cs0_muxreg),
  293. },
  294. };
  295. static struct spear_pingroup ssp0_cs0_pingroup = {
  296. .name = "ssp0_cs0_grp",
  297. .pins = ssp0_cs0_pins,
  298. .npins = ARRAY_SIZE(ssp0_cs0_pins),
  299. .modemuxs = ssp0_cs0_modemux,
  300. .nmodemuxs = ARRAY_SIZE(ssp0_cs0_modemux),
  301. };
  302. /* ssp0_cs1_2 device */
  303. static const unsigned ssp0_cs1_2_pins[] = { 94, 95 };
  304. static struct spear_muxreg ssp0_cs1_2_muxreg[] = {
  305. {
  306. .reg = PAD_FUNCTION_EN_2,
  307. .mask = PMX_SSP0_CS1_2_MASK,
  308. .val = PMX_SSP0_CS1_2_MASK,
  309. }, {
  310. .reg = PAD_DIRECTION_SEL_2,
  311. .mask = PMX_SSP0_CS1_2_MASK,
  312. .val = PMX_SSP0_CS1_2_MASK,
  313. },
  314. };
  315. static struct spear_modemux ssp0_cs1_2_modemux[] = {
  316. {
  317. .muxregs = ssp0_cs1_2_muxreg,
  318. .nmuxregs = ARRAY_SIZE(ssp0_cs1_2_muxreg),
  319. },
  320. };
  321. static struct spear_pingroup ssp0_cs1_2_pingroup = {
  322. .name = "ssp0_cs1_2_grp",
  323. .pins = ssp0_cs1_2_pins,
  324. .npins = ARRAY_SIZE(ssp0_cs1_2_pins),
  325. .modemuxs = ssp0_cs1_2_modemux,
  326. .nmodemuxs = ARRAY_SIZE(ssp0_cs1_2_modemux),
  327. };
  328. static const char *const ssp0_grps[] = { "ssp0_grp", "ssp0_cs0_grp",
  329. "ssp0_cs1_2_grp" };
  330. static struct spear_function ssp0_function = {
  331. .name = "ssp0",
  332. .groups = ssp0_grps,
  333. .ngroups = ARRAY_SIZE(ssp0_grps),
  334. };
  335. /* Pad multiplexing for i2s0 device */
  336. static const unsigned i2s0_pins[] = { 104, 105, 106, 107, 108 };
  337. static struct spear_muxreg i2s0_muxreg[] = {
  338. {
  339. .reg = PAD_FUNCTION_EN_0,
  340. .mask = PMX_I2S0_MASK,
  341. .val = PMX_I2S0_MASK,
  342. }, {
  343. .reg = PAD_DIRECTION_SEL_0,
  344. .mask = PMX_I2S0_MASK,
  345. .val = PMX_I2S0_MASK,
  346. },
  347. };
  348. static struct spear_modemux i2s0_modemux[] = {
  349. {
  350. .muxregs = i2s0_muxreg,
  351. .nmuxregs = ARRAY_SIZE(i2s0_muxreg),
  352. },
  353. };
  354. static struct spear_pingroup i2s0_pingroup = {
  355. .name = "i2s0_grp",
  356. .pins = i2s0_pins,
  357. .npins = ARRAY_SIZE(i2s0_pins),
  358. .modemuxs = i2s0_modemux,
  359. .nmodemuxs = ARRAY_SIZE(i2s0_modemux),
  360. };
  361. static const char *const i2s0_grps[] = { "i2s0_grp" };
  362. static struct spear_function i2s0_function = {
  363. .name = "i2s0",
  364. .groups = i2s0_grps,
  365. .ngroups = ARRAY_SIZE(i2s0_grps),
  366. };
  367. /* Pad multiplexing for i2s1 device */
  368. static const unsigned i2s1_pins[] = { 0, 1, 2, 3 };
  369. static struct spear_muxreg i2s1_muxreg[] = {
  370. {
  371. .reg = PAD_FUNCTION_EN_1,
  372. .mask = PMX_I2S1_MASK,
  373. .val = PMX_I2S1_MASK,
  374. }, {
  375. .reg = PAD_DIRECTION_SEL_1,
  376. .mask = PMX_I2S1_MASK,
  377. .val = PMX_I2S1_MASK,
  378. },
  379. };
  380. static struct spear_modemux i2s1_modemux[] = {
  381. {
  382. .muxregs = i2s1_muxreg,
  383. .nmuxregs = ARRAY_SIZE(i2s1_muxreg),
  384. },
  385. };
  386. static struct spear_pingroup i2s1_pingroup = {
  387. .name = "i2s1_grp",
  388. .pins = i2s1_pins,
  389. .npins = ARRAY_SIZE(i2s1_pins),
  390. .modemuxs = i2s1_modemux,
  391. .nmodemuxs = ARRAY_SIZE(i2s1_modemux),
  392. };
  393. static const char *const i2s1_grps[] = { "i2s1_grp" };
  394. static struct spear_function i2s1_function = {
  395. .name = "i2s1",
  396. .groups = i2s1_grps,
  397. .ngroups = ARRAY_SIZE(i2s1_grps),
  398. };
  399. /* Pad multiplexing for clcd device */
  400. static const unsigned clcd_pins[] = { 113, 114, 115, 116, 117, 118, 119, 120,
  401. 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
  402. 135, 136, 137, 138, 139, 140, 141, 142 };
  403. static struct spear_muxreg clcd_muxreg[] = {
  404. {
  405. .reg = PAD_FUNCTION_EN_0,
  406. .mask = PMX_CLCD1_MASK,
  407. .val = PMX_CLCD1_MASK,
  408. }, {
  409. .reg = PAD_DIRECTION_SEL_0,
  410. .mask = PMX_CLCD1_MASK,
  411. .val = PMX_CLCD1_MASK,
  412. },
  413. };
  414. static struct spear_modemux clcd_modemux[] = {
  415. {
  416. .muxregs = clcd_muxreg,
  417. .nmuxregs = ARRAY_SIZE(clcd_muxreg),
  418. },
  419. };
  420. static struct spear_pingroup clcd_pingroup = {
  421. .name = "clcd_grp",
  422. .pins = clcd_pins,
  423. .npins = ARRAY_SIZE(clcd_pins),
  424. .modemuxs = clcd_modemux,
  425. .nmodemuxs = ARRAY_SIZE(clcd_modemux),
  426. };
  427. static const unsigned clcd_high_res_pins[] = { 30, 31, 32, 33, 34, 35, 36, 37,
  428. 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 };
  429. static struct spear_muxreg clcd_high_res_muxreg[] = {
  430. {
  431. .reg = PAD_FUNCTION_EN_1,
  432. .mask = PMX_CLCD2_MASK,
  433. .val = PMX_CLCD2_MASK,
  434. }, {
  435. .reg = PAD_DIRECTION_SEL_1,
  436. .mask = PMX_CLCD2_MASK,
  437. .val = PMX_CLCD2_MASK,
  438. },
  439. };
  440. static struct spear_modemux clcd_high_res_modemux[] = {
  441. {
  442. .muxregs = clcd_high_res_muxreg,
  443. .nmuxregs = ARRAY_SIZE(clcd_high_res_muxreg),
  444. },
  445. };
  446. static struct spear_pingroup clcd_high_res_pingroup = {
  447. .name = "clcd_high_res_grp",
  448. .pins = clcd_high_res_pins,
  449. .npins = ARRAY_SIZE(clcd_high_res_pins),
  450. .modemuxs = clcd_high_res_modemux,
  451. .nmodemuxs = ARRAY_SIZE(clcd_high_res_modemux),
  452. };
  453. static const char *const clcd_grps[] = { "clcd_grp", "clcd_high_res_grp" };
  454. static struct spear_function clcd_function = {
  455. .name = "clcd",
  456. .groups = clcd_grps,
  457. .ngroups = ARRAY_SIZE(clcd_grps),
  458. };
  459. static const unsigned arm_gpio_pins[] = { 18, 19, 20, 21, 22, 23, 143, 144, 145,
  460. 146, 147, 148, 149, 150, 151, 152 };
  461. static struct spear_muxreg arm_gpio_muxreg[] = {
  462. {
  463. .reg = PAD_FUNCTION_EN_0,
  464. .mask = PMX_EGPIO_0_GRP_MASK,
  465. .val = PMX_EGPIO_0_GRP_MASK,
  466. }, {
  467. .reg = PAD_FUNCTION_EN_1,
  468. .mask = PMX_EGPIO_1_GRP_MASK,
  469. .val = PMX_EGPIO_1_GRP_MASK,
  470. }, {
  471. .reg = PAD_DIRECTION_SEL_0,
  472. .mask = PMX_EGPIO_0_GRP_MASK,
  473. .val = PMX_EGPIO_0_GRP_MASK,
  474. }, {
  475. .reg = PAD_DIRECTION_SEL_1,
  476. .mask = PMX_EGPIO_1_GRP_MASK,
  477. .val = PMX_EGPIO_1_GRP_MASK,
  478. },
  479. };
  480. static struct spear_modemux arm_gpio_modemux[] = {
  481. {
  482. .muxregs = arm_gpio_muxreg,
  483. .nmuxregs = ARRAY_SIZE(arm_gpio_muxreg),
  484. },
  485. };
  486. static struct spear_pingroup arm_gpio_pingroup = {
  487. .name = "arm_gpio_grp",
  488. .pins = arm_gpio_pins,
  489. .npins = ARRAY_SIZE(arm_gpio_pins),
  490. .modemuxs = arm_gpio_modemux,
  491. .nmodemuxs = ARRAY_SIZE(arm_gpio_modemux),
  492. };
  493. static const char *const arm_gpio_grps[] = { "arm_gpio_grp" };
  494. static struct spear_function arm_gpio_function = {
  495. .name = "arm_gpio",
  496. .groups = arm_gpio_grps,
  497. .ngroups = ARRAY_SIZE(arm_gpio_grps),
  498. };
  499. /* Pad multiplexing for smi 2 chips device */
  500. static const unsigned smi_2_chips_pins[] = { 153, 154, 155, 156, 157 };
  501. static struct spear_muxreg smi_2_chips_muxreg[] = {
  502. {
  503. .reg = PAD_FUNCTION_EN_0,
  504. .mask = PMX_SMI_MASK,
  505. .val = PMX_SMI_MASK,
  506. }, {
  507. .reg = PAD_DIRECTION_SEL_0,
  508. .mask = PMX_SMI_MASK,
  509. .val = PMX_SMI_MASK,
  510. },
  511. };
  512. static struct spear_modemux smi_2_chips_modemux[] = {
  513. {
  514. .muxregs = smi_2_chips_muxreg,
  515. .nmuxregs = ARRAY_SIZE(smi_2_chips_muxreg),
  516. },
  517. };
  518. static struct spear_pingroup smi_2_chips_pingroup = {
  519. .name = "smi_2_chips_grp",
  520. .pins = smi_2_chips_pins,
  521. .npins = ARRAY_SIZE(smi_2_chips_pins),
  522. .modemuxs = smi_2_chips_modemux,
  523. .nmodemuxs = ARRAY_SIZE(smi_2_chips_modemux),
  524. };
  525. static const unsigned smi_4_chips_pins[] = { 54, 55 };
  526. static struct spear_muxreg smi_4_chips_muxreg[] = {
  527. {
  528. .reg = PAD_FUNCTION_EN_0,
  529. .mask = PMX_SMI_MASK,
  530. .val = PMX_SMI_MASK,
  531. }, {
  532. .reg = PAD_FUNCTION_EN_1,
  533. .mask = PMX_SMINCS2_MASK | PMX_SMINCS3_MASK,
  534. .val = PMX_SMINCS2_MASK | PMX_SMINCS3_MASK,
  535. }, {
  536. .reg = PAD_DIRECTION_SEL_0,
  537. .mask = PMX_SMI_MASK,
  538. .val = PMX_SMI_MASK,
  539. }, {
  540. .reg = PAD_DIRECTION_SEL_1,
  541. .mask = PMX_SMINCS2_MASK | PMX_SMINCS3_MASK,
  542. .val = PMX_SMINCS2_MASK | PMX_SMINCS3_MASK,
  543. },
  544. };
  545. static struct spear_modemux smi_4_chips_modemux[] = {
  546. {
  547. .muxregs = smi_4_chips_muxreg,
  548. .nmuxregs = ARRAY_SIZE(smi_4_chips_muxreg),
  549. },
  550. };
  551. static struct spear_pingroup smi_4_chips_pingroup = {
  552. .name = "smi_4_chips_grp",
  553. .pins = smi_4_chips_pins,
  554. .npins = ARRAY_SIZE(smi_4_chips_pins),
  555. .modemuxs = smi_4_chips_modemux,
  556. .nmodemuxs = ARRAY_SIZE(smi_4_chips_modemux),
  557. };
  558. static const char *const smi_grps[] = { "smi_2_chips_grp", "smi_4_chips_grp" };
  559. static struct spear_function smi_function = {
  560. .name = "smi",
  561. .groups = smi_grps,
  562. .ngroups = ARRAY_SIZE(smi_grps),
  563. };
  564. /* Pad multiplexing for gmii device */
  565. static const unsigned gmii_pins[] = { 173, 174, 175, 176, 177, 178, 179, 180,
  566. 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
  567. 195, 196, 197, 198, 199, 200 };
  568. static struct spear_muxreg gmii_muxreg[] = {
  569. {
  570. .reg = PAD_FUNCTION_EN_0,
  571. .mask = PMX_GMII_MASK,
  572. .val = PMX_GMII_MASK,
  573. }, {
  574. .reg = PAD_DIRECTION_SEL_0,
  575. .mask = PMX_GMII_MASK,
  576. .val = PMX_GMII_MASK,
  577. },
  578. };
  579. static struct spear_modemux gmii_modemux[] = {
  580. {
  581. .muxregs = gmii_muxreg,
  582. .nmuxregs = ARRAY_SIZE(gmii_muxreg),
  583. },
  584. };
  585. static struct spear_pingroup gmii_pingroup = {
  586. .name = "gmii_grp",
  587. .pins = gmii_pins,
  588. .npins = ARRAY_SIZE(gmii_pins),
  589. .modemuxs = gmii_modemux,
  590. .nmodemuxs = ARRAY_SIZE(gmii_modemux),
  591. };
  592. static const char *const gmii_grps[] = { "gmii_grp" };
  593. static struct spear_function gmii_function = {
  594. .name = "gmii",
  595. .groups = gmii_grps,
  596. .ngroups = ARRAY_SIZE(gmii_grps),
  597. };
  598. /* Pad multiplexing for rgmii device */
  599. static const unsigned rgmii_pins[] = { 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
  600. 28, 29, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 175,
  601. 180, 181, 182, 183, 185, 188, 193, 194, 195, 196, 197, 198, 211, 212 };
  602. static struct spear_muxreg rgmii_muxreg[] = {
  603. {
  604. .reg = PAD_FUNCTION_EN_0,
  605. .mask = PMX_RGMII_REG0_MASK,
  606. .val = 0,
  607. }, {
  608. .reg = PAD_FUNCTION_EN_1,
  609. .mask = PMX_RGMII_REG1_MASK,
  610. .val = 0,
  611. }, {
  612. .reg = PAD_FUNCTION_EN_2,
  613. .mask = PMX_RGMII_REG2_MASK,
  614. .val = 0,
  615. }, {
  616. .reg = PAD_DIRECTION_SEL_0,
  617. .mask = PMX_RGMII_REG0_MASK,
  618. .val = PMX_RGMII_REG0_MASK,
  619. }, {
  620. .reg = PAD_DIRECTION_SEL_1,
  621. .mask = PMX_RGMII_REG1_MASK,
  622. .val = PMX_RGMII_REG1_MASK,
  623. }, {
  624. .reg = PAD_DIRECTION_SEL_2,
  625. .mask = PMX_RGMII_REG2_MASK,
  626. .val = PMX_RGMII_REG2_MASK,
  627. },
  628. };
  629. static struct spear_modemux rgmii_modemux[] = {
  630. {
  631. .muxregs = rgmii_muxreg,
  632. .nmuxregs = ARRAY_SIZE(rgmii_muxreg),
  633. },
  634. };
  635. static struct spear_pingroup rgmii_pingroup = {
  636. .name = "rgmii_grp",
  637. .pins = rgmii_pins,
  638. .npins = ARRAY_SIZE(rgmii_pins),
  639. .modemuxs = rgmii_modemux,
  640. .nmodemuxs = ARRAY_SIZE(rgmii_modemux),
  641. };
  642. static const char *const rgmii_grps[] = { "rgmii_grp" };
  643. static struct spear_function rgmii_function = {
  644. .name = "rgmii",
  645. .groups = rgmii_grps,
  646. .ngroups = ARRAY_SIZE(rgmii_grps),
  647. };
  648. /* Pad multiplexing for smii_0_1_2 device */
  649. static const unsigned smii_0_1_2_pins[] = { 24, 25, 26, 27, 28, 29, 30, 31, 32,
  650. 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
  651. 51, 52, 53, 54, 55 };
  652. static struct spear_muxreg smii_0_1_2_muxreg[] = {
  653. {
  654. .reg = PAD_FUNCTION_EN_1,
  655. .mask = PMX_SMII_0_1_2_MASK,
  656. .val = 0,
  657. }, {
  658. .reg = PAD_DIRECTION_SEL_1,
  659. .mask = PMX_SMII_0_1_2_MASK,
  660. .val = PMX_SMII_0_1_2_MASK,
  661. },
  662. };
  663. static struct spear_modemux smii_0_1_2_modemux[] = {
  664. {
  665. .muxregs = smii_0_1_2_muxreg,
  666. .nmuxregs = ARRAY_SIZE(smii_0_1_2_muxreg),
  667. },
  668. };
  669. static struct spear_pingroup smii_0_1_2_pingroup = {
  670. .name = "smii_0_1_2_grp",
  671. .pins = smii_0_1_2_pins,
  672. .npins = ARRAY_SIZE(smii_0_1_2_pins),
  673. .modemuxs = smii_0_1_2_modemux,
  674. .nmodemuxs = ARRAY_SIZE(smii_0_1_2_modemux),
  675. };
  676. static const char *const smii_0_1_2_grps[] = { "smii_0_1_2_grp" };
  677. static struct spear_function smii_0_1_2_function = {
  678. .name = "smii_0_1_2",
  679. .groups = smii_0_1_2_grps,
  680. .ngroups = ARRAY_SIZE(smii_0_1_2_grps),
  681. };
  682. /* Pad multiplexing for ras_mii_txclk device */
  683. static const unsigned ras_mii_txclk_pins[] = { 98, 99 };
  684. static struct spear_muxreg ras_mii_txclk_muxreg[] = {
  685. {
  686. .reg = PAD_FUNCTION_EN_1,
  687. .mask = PMX_NFCE2_MASK,
  688. .val = 0,
  689. }, {
  690. .reg = PAD_DIRECTION_SEL_1,
  691. .mask = PMX_NFCE2_MASK,
  692. .val = PMX_NFCE2_MASK,
  693. },
  694. };
  695. static struct spear_modemux ras_mii_txclk_modemux[] = {
  696. {
  697. .muxregs = ras_mii_txclk_muxreg,
  698. .nmuxregs = ARRAY_SIZE(ras_mii_txclk_muxreg),
  699. },
  700. };
  701. static struct spear_pingroup ras_mii_txclk_pingroup = {
  702. .name = "ras_mii_txclk_grp",
  703. .pins = ras_mii_txclk_pins,
  704. .npins = ARRAY_SIZE(ras_mii_txclk_pins),
  705. .modemuxs = ras_mii_txclk_modemux,
  706. .nmodemuxs = ARRAY_SIZE(ras_mii_txclk_modemux),
  707. };
  708. static const char *const ras_mii_txclk_grps[] = { "ras_mii_txclk_grp" };
  709. static struct spear_function ras_mii_txclk_function = {
  710. .name = "ras_mii_txclk",
  711. .groups = ras_mii_txclk_grps,
  712. .ngroups = ARRAY_SIZE(ras_mii_txclk_grps),
  713. };
  714. /* Pad multiplexing for nand 8bit device (cs0 only) */
  715. static const unsigned nand_8bit_pins[] = { 56, 57, 58, 59, 60, 61, 62, 63, 64,
  716. 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
  717. 83, 84, 85, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
  718. 170, 171, 172, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
  719. 212 };
  720. static struct spear_muxreg nand_8bit_muxreg[] = {
  721. {
  722. .reg = PAD_FUNCTION_EN_0,
  723. .mask = PMX_NAND8BIT_0_MASK,
  724. .val = PMX_NAND8BIT_0_MASK,
  725. }, {
  726. .reg = PAD_FUNCTION_EN_1,
  727. .mask = PMX_NAND8BIT_1_MASK,
  728. .val = PMX_NAND8BIT_1_MASK,
  729. }, {
  730. .reg = PAD_DIRECTION_SEL_0,
  731. .mask = PMX_NAND8BIT_0_MASK,
  732. .val = PMX_NAND8BIT_0_MASK,
  733. }, {
  734. .reg = PAD_DIRECTION_SEL_1,
  735. .mask = PMX_NAND8BIT_1_MASK,
  736. .val = PMX_NAND8BIT_1_MASK,
  737. },
  738. };
  739. static struct spear_modemux nand_8bit_modemux[] = {
  740. {
  741. .muxregs = nand_8bit_muxreg,
  742. .nmuxregs = ARRAY_SIZE(nand_8bit_muxreg),
  743. },
  744. };
  745. static struct spear_pingroup nand_8bit_pingroup = {
  746. .name = "nand_8bit_grp",
  747. .pins = nand_8bit_pins,
  748. .npins = ARRAY_SIZE(nand_8bit_pins),
  749. .modemuxs = nand_8bit_modemux,
  750. .nmodemuxs = ARRAY_SIZE(nand_8bit_modemux),
  751. };
  752. /* Pad multiplexing for nand 16bit device */
  753. static const unsigned nand_16bit_pins[] = { 201, 202, 203, 204, 207, 208, 209,
  754. 210 };
  755. static struct spear_muxreg nand_16bit_muxreg[] = {
  756. {
  757. .reg = PAD_FUNCTION_EN_1,
  758. .mask = PMX_NAND16BIT_1_MASK,
  759. .val = PMX_NAND16BIT_1_MASK,
  760. }, {
  761. .reg = PAD_DIRECTION_SEL_1,
  762. .mask = PMX_NAND16BIT_1_MASK,
  763. .val = PMX_NAND16BIT_1_MASK,
  764. },
  765. };
  766. static struct spear_modemux nand_16bit_modemux[] = {
  767. {
  768. .muxregs = nand_16bit_muxreg,
  769. .nmuxregs = ARRAY_SIZE(nand_16bit_muxreg),
  770. },
  771. };
  772. static struct spear_pingroup nand_16bit_pingroup = {
  773. .name = "nand_16bit_grp",
  774. .pins = nand_16bit_pins,
  775. .npins = ARRAY_SIZE(nand_16bit_pins),
  776. .modemuxs = nand_16bit_modemux,
  777. .nmodemuxs = ARRAY_SIZE(nand_16bit_modemux),
  778. };
  779. /* Pad multiplexing for nand 4 chips */
  780. static const unsigned nand_4_chips_pins[] = { 205, 206, 211, 212 };
  781. static struct spear_muxreg nand_4_chips_muxreg[] = {
  782. {
  783. .reg = PAD_FUNCTION_EN_1,
  784. .mask = PMX_NAND_4CHIPS_MASK,
  785. .val = PMX_NAND_4CHIPS_MASK,
  786. }, {
  787. .reg = PAD_DIRECTION_SEL_1,
  788. .mask = PMX_NAND_4CHIPS_MASK,
  789. .val = PMX_NAND_4CHIPS_MASK,
  790. },
  791. };
  792. static struct spear_modemux nand_4_chips_modemux[] = {
  793. {
  794. .muxregs = nand_4_chips_muxreg,
  795. .nmuxregs = ARRAY_SIZE(nand_4_chips_muxreg),
  796. },
  797. };
  798. static struct spear_pingroup nand_4_chips_pingroup = {
  799. .name = "nand_4_chips_grp",
  800. .pins = nand_4_chips_pins,
  801. .npins = ARRAY_SIZE(nand_4_chips_pins),
  802. .modemuxs = nand_4_chips_modemux,
  803. .nmodemuxs = ARRAY_SIZE(nand_4_chips_modemux),
  804. };
  805. static const char *const nand_grps[] = { "nand_8bit_grp", "nand_16bit_grp",
  806. "nand_4_chips_grp" };
  807. static struct spear_function nand_function = {
  808. .name = "nand",
  809. .groups = nand_grps,
  810. .ngroups = ARRAY_SIZE(nand_grps),
  811. };
  812. /* Pad multiplexing for keyboard_6x6 device */
  813. static const unsigned keyboard_6x6_pins[] = { 201, 202, 203, 204, 205, 206, 207,
  814. 208, 209, 210, 211, 212 };
  815. static struct spear_muxreg keyboard_6x6_muxreg[] = {
  816. {
  817. .reg = PAD_FUNCTION_EN_1,
  818. .mask = PMX_KEYBOARD_6X6_MASK | PMX_NFIO8_15_MASK |
  819. PMX_NFCE1_MASK | PMX_NFCE2_MASK | PMX_NFWPRT1_MASK |
  820. PMX_NFWPRT2_MASK,
  821. .val = PMX_KEYBOARD_6X6_MASK,
  822. },
  823. };
  824. static struct spear_modemux keyboard_6x6_modemux[] = {
  825. {
  826. .muxregs = keyboard_6x6_muxreg,
  827. .nmuxregs = ARRAY_SIZE(keyboard_6x6_muxreg),
  828. },
  829. };
  830. static struct spear_pingroup keyboard_6x6_pingroup = {
  831. .name = "keyboard_6x6_grp",
  832. .pins = keyboard_6x6_pins,
  833. .npins = ARRAY_SIZE(keyboard_6x6_pins),
  834. .modemuxs = keyboard_6x6_modemux,
  835. .nmodemuxs = ARRAY_SIZE(keyboard_6x6_modemux),
  836. };
  837. /* Pad multiplexing for keyboard_rowcol6_8 device */
  838. static const unsigned keyboard_rowcol6_8_pins[] = { 24, 25, 26, 27, 28, 29 };
  839. static struct spear_muxreg keyboard_rowcol6_8_muxreg[] = {
  840. {
  841. .reg = PAD_FUNCTION_EN_1,
  842. .mask = PMX_KBD_ROWCOL68_MASK,
  843. .val = PMX_KBD_ROWCOL68_MASK,
  844. }, {
  845. .reg = PAD_DIRECTION_SEL_1,
  846. .mask = PMX_KBD_ROWCOL68_MASK,
  847. .val = PMX_KBD_ROWCOL68_MASK,
  848. },
  849. };
  850. static struct spear_modemux keyboard_rowcol6_8_modemux[] = {
  851. {
  852. .muxregs = keyboard_rowcol6_8_muxreg,
  853. .nmuxregs = ARRAY_SIZE(keyboard_rowcol6_8_muxreg),
  854. },
  855. };
  856. static struct spear_pingroup keyboard_rowcol6_8_pingroup = {
  857. .name = "keyboard_rowcol6_8_grp",
  858. .pins = keyboard_rowcol6_8_pins,
  859. .npins = ARRAY_SIZE(keyboard_rowcol6_8_pins),
  860. .modemuxs = keyboard_rowcol6_8_modemux,
  861. .nmodemuxs = ARRAY_SIZE(keyboard_rowcol6_8_modemux),
  862. };
  863. static const char *const keyboard_grps[] = { "keyboard_6x6_grp",
  864. "keyboard_rowcol6_8_grp" };
  865. static struct spear_function keyboard_function = {
  866. .name = "keyboard",
  867. .groups = keyboard_grps,
  868. .ngroups = ARRAY_SIZE(keyboard_grps),
  869. };
  870. /* Pad multiplexing for uart0 device */
  871. static const unsigned uart0_pins[] = { 100, 101 };
  872. static struct spear_muxreg uart0_muxreg[] = {
  873. {
  874. .reg = PAD_FUNCTION_EN_0,
  875. .mask = PMX_UART0_MASK,
  876. .val = PMX_UART0_MASK,
  877. }, {
  878. .reg = PAD_DIRECTION_SEL_0,
  879. .mask = PMX_UART0_MASK,
  880. .val = PMX_UART0_MASK,
  881. },
  882. };
  883. static struct spear_modemux uart0_modemux[] = {
  884. {
  885. .muxregs = uart0_muxreg,
  886. .nmuxregs = ARRAY_SIZE(uart0_muxreg),
  887. },
  888. };
  889. static struct spear_pingroup uart0_pingroup = {
  890. .name = "uart0_grp",
  891. .pins = uart0_pins,
  892. .npins = ARRAY_SIZE(uart0_pins),
  893. .modemuxs = uart0_modemux,
  894. .nmodemuxs = ARRAY_SIZE(uart0_modemux),
  895. };
  896. /* Pad multiplexing for uart0_modem device */
  897. static const unsigned uart0_modem_pins[] = { 12, 13, 14, 15, 16, 17 };
  898. static struct spear_muxreg uart0_modem_muxreg[] = {
  899. {
  900. .reg = PAD_FUNCTION_EN_1,
  901. .mask = PMX_UART0_MODEM_MASK,
  902. .val = PMX_UART0_MODEM_MASK,
  903. }, {
  904. .reg = PAD_DIRECTION_SEL_1,
  905. .mask = PMX_UART0_MODEM_MASK,
  906. .val = PMX_UART0_MODEM_MASK,
  907. },
  908. };
  909. static struct spear_modemux uart0_modem_modemux[] = {
  910. {
  911. .muxregs = uart0_modem_muxreg,
  912. .nmuxregs = ARRAY_SIZE(uart0_modem_muxreg),
  913. },
  914. };
  915. static struct spear_pingroup uart0_modem_pingroup = {
  916. .name = "uart0_modem_grp",
  917. .pins = uart0_modem_pins,
  918. .npins = ARRAY_SIZE(uart0_modem_pins),
  919. .modemuxs = uart0_modem_modemux,
  920. .nmodemuxs = ARRAY_SIZE(uart0_modem_modemux),
  921. };
  922. static const char *const uart0_grps[] = { "uart0_grp", "uart0_modem_grp" };
  923. static struct spear_function uart0_function = {
  924. .name = "uart0",
  925. .groups = uart0_grps,
  926. .ngroups = ARRAY_SIZE(uart0_grps),
  927. };
  928. /* Pad multiplexing for gpt0_tmr0 device */
  929. static const unsigned gpt0_tmr0_pins[] = { 10, 11 };
  930. static struct spear_muxreg gpt0_tmr0_muxreg[] = {
  931. {
  932. .reg = PAD_FUNCTION_EN_1,
  933. .mask = PMX_GPT0_TMR0_MASK,
  934. .val = PMX_GPT0_TMR0_MASK,
  935. }, {
  936. .reg = PAD_DIRECTION_SEL_1,
  937. .mask = PMX_GPT0_TMR0_MASK,
  938. .val = PMX_GPT0_TMR0_MASK,
  939. },
  940. };
  941. static struct spear_modemux gpt0_tmr0_modemux[] = {
  942. {
  943. .muxregs = gpt0_tmr0_muxreg,
  944. .nmuxregs = ARRAY_SIZE(gpt0_tmr0_muxreg),
  945. },
  946. };
  947. static struct spear_pingroup gpt0_tmr0_pingroup = {
  948. .name = "gpt0_tmr0_grp",
  949. .pins = gpt0_tmr0_pins,
  950. .npins = ARRAY_SIZE(gpt0_tmr0_pins),
  951. .modemuxs = gpt0_tmr0_modemux,
  952. .nmodemuxs = ARRAY_SIZE(gpt0_tmr0_modemux),
  953. };
  954. /* Pad multiplexing for gpt0_tmr1 device */
  955. static const unsigned gpt0_tmr1_pins[] = { 8, 9 };
  956. static struct spear_muxreg gpt0_tmr1_muxreg[] = {
  957. {
  958. .reg = PAD_FUNCTION_EN_1,
  959. .mask = PMX_GPT0_TMR1_MASK,
  960. .val = PMX_GPT0_TMR1_MASK,
  961. }, {
  962. .reg = PAD_DIRECTION_SEL_1,
  963. .mask = PMX_GPT0_TMR1_MASK,
  964. .val = PMX_GPT0_TMR1_MASK,
  965. },
  966. };
  967. static struct spear_modemux gpt0_tmr1_modemux[] = {
  968. {
  969. .muxregs = gpt0_tmr1_muxreg,
  970. .nmuxregs = ARRAY_SIZE(gpt0_tmr1_muxreg),
  971. },
  972. };
  973. static struct spear_pingroup gpt0_tmr1_pingroup = {
  974. .name = "gpt0_tmr1_grp",
  975. .pins = gpt0_tmr1_pins,
  976. .npins = ARRAY_SIZE(gpt0_tmr1_pins),
  977. .modemuxs = gpt0_tmr1_modemux,
  978. .nmodemuxs = ARRAY_SIZE(gpt0_tmr1_modemux),
  979. };
  980. static const char *const gpt0_grps[] = { "gpt0_tmr0_grp", "gpt0_tmr1_grp" };
  981. static struct spear_function gpt0_function = {
  982. .name = "gpt0",
  983. .groups = gpt0_grps,
  984. .ngroups = ARRAY_SIZE(gpt0_grps),
  985. };
  986. /* Pad multiplexing for gpt1_tmr0 device */
  987. static const unsigned gpt1_tmr0_pins[] = { 6, 7 };
  988. static struct spear_muxreg gpt1_tmr0_muxreg[] = {
  989. {
  990. .reg = PAD_FUNCTION_EN_1,
  991. .mask = PMX_GPT1_TMR0_MASK,
  992. .val = PMX_GPT1_TMR0_MASK,
  993. }, {
  994. .reg = PAD_DIRECTION_SEL_1,
  995. .mask = PMX_GPT1_TMR0_MASK,
  996. .val = PMX_GPT1_TMR0_MASK,
  997. },
  998. };
  999. static struct spear_modemux gpt1_tmr0_modemux[] = {
  1000. {
  1001. .muxregs = gpt1_tmr0_muxreg,
  1002. .nmuxregs = ARRAY_SIZE(gpt1_tmr0_muxreg),
  1003. },
  1004. };
  1005. static struct spear_pingroup gpt1_tmr0_pingroup = {
  1006. .name = "gpt1_tmr0_grp",
  1007. .pins = gpt1_tmr0_pins,
  1008. .npins = ARRAY_SIZE(gpt1_tmr0_pins),
  1009. .modemuxs = gpt1_tmr0_modemux,
  1010. .nmodemuxs = ARRAY_SIZE(gpt1_tmr0_modemux),
  1011. };
  1012. /* Pad multiplexing for gpt1_tmr1 device */
  1013. static const unsigned gpt1_tmr1_pins[] = { 4, 5 };
  1014. static struct spear_muxreg gpt1_tmr1_muxreg[] = {
  1015. {
  1016. .reg = PAD_FUNCTION_EN_1,
  1017. .mask = PMX_GPT1_TMR1_MASK,
  1018. .val = PMX_GPT1_TMR1_MASK,
  1019. }, {
  1020. .reg = PAD_DIRECTION_SEL_1,
  1021. .mask = PMX_GPT1_TMR1_MASK,
  1022. .val = PMX_GPT1_TMR1_MASK,
  1023. },
  1024. };
  1025. static struct spear_modemux gpt1_tmr1_modemux[] = {
  1026. {
  1027. .muxregs = gpt1_tmr1_muxreg,
  1028. .nmuxregs = ARRAY_SIZE(gpt1_tmr1_muxreg),
  1029. },
  1030. };
  1031. static struct spear_pingroup gpt1_tmr1_pingroup = {
  1032. .name = "gpt1_tmr1_grp",
  1033. .pins = gpt1_tmr1_pins,
  1034. .npins = ARRAY_SIZE(gpt1_tmr1_pins),
  1035. .modemuxs = gpt1_tmr1_modemux,
  1036. .nmodemuxs = ARRAY_SIZE(gpt1_tmr1_modemux),
  1037. };
  1038. static const char *const gpt1_grps[] = { "gpt1_tmr1_grp", "gpt1_tmr0_grp" };
  1039. static struct spear_function gpt1_function = {
  1040. .name = "gpt1",
  1041. .groups = gpt1_grps,
  1042. .ngroups = ARRAY_SIZE(gpt1_grps),
  1043. };
  1044. /* Pad multiplexing for mcif device */
  1045. static const unsigned mcif_pins[] = { 86, 87, 88, 89, 90, 91, 92, 93, 213, 214,
  1046. 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
  1047. 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242,
  1048. 243, 244, 245 };
  1049. #define MCIF_MUXREG \
  1050. { \
  1051. .reg = PAD_FUNCTION_EN_0, \
  1052. .mask = PMX_MCI_DATA8_15_MASK, \
  1053. .val = PMX_MCI_DATA8_15_MASK, \
  1054. }, { \
  1055. .reg = PAD_FUNCTION_EN_1, \
  1056. .mask = PMX_MCIFALL_1_MASK | PMX_NFWPRT1_MASK | \
  1057. PMX_NFWPRT2_MASK, \
  1058. .val = PMX_MCIFALL_1_MASK, \
  1059. }, { \
  1060. .reg = PAD_FUNCTION_EN_2, \
  1061. .mask = PMX_MCIFALL_2_MASK, \
  1062. .val = PMX_MCIFALL_2_MASK, \
  1063. }, { \
  1064. .reg = PAD_DIRECTION_SEL_0, \
  1065. .mask = PMX_MCI_DATA8_15_MASK, \
  1066. .val = PMX_MCI_DATA8_15_MASK, \
  1067. }, { \
  1068. .reg = PAD_DIRECTION_SEL_1, \
  1069. .mask = PMX_MCIFALL_1_MASK | PMX_NFWPRT1_MASK | \
  1070. PMX_NFWPRT2_MASK, \
  1071. .val = PMX_MCIFALL_1_MASK | PMX_NFWPRT1_MASK | \
  1072. PMX_NFWPRT2_MASK, \
  1073. }, { \
  1074. .reg = PAD_DIRECTION_SEL_2, \
  1075. .mask = PMX_MCIFALL_2_MASK, \
  1076. .val = PMX_MCIFALL_2_MASK, \
  1077. }
  1078. /* sdhci device */
  1079. static struct spear_muxreg sdhci_muxreg[] = {
  1080. MCIF_MUXREG,
  1081. {
  1082. .reg = PERIP_CFG,
  1083. .mask = MCIF_SEL_MASK,
  1084. .val = MCIF_SEL_SD,
  1085. },
  1086. };
  1087. static struct spear_modemux sdhci_modemux[] = {
  1088. {
  1089. .muxregs = sdhci_muxreg,
  1090. .nmuxregs = ARRAY_SIZE(sdhci_muxreg),
  1091. },
  1092. };
  1093. static struct spear_pingroup sdhci_pingroup = {
  1094. .name = "sdhci_grp",
  1095. .pins = mcif_pins,
  1096. .npins = ARRAY_SIZE(mcif_pins),
  1097. .modemuxs = sdhci_modemux,
  1098. .nmodemuxs = ARRAY_SIZE(sdhci_modemux),
  1099. };
  1100. static const char *const sdhci_grps[] = { "sdhci_grp" };
  1101. static struct spear_function sdhci_function = {
  1102. .name = "sdhci",
  1103. .groups = sdhci_grps,
  1104. .ngroups = ARRAY_SIZE(sdhci_grps),
  1105. };
  1106. /* cf device */
  1107. static struct spear_muxreg cf_muxreg[] = {
  1108. MCIF_MUXREG,
  1109. {
  1110. .reg = PERIP_CFG,
  1111. .mask = MCIF_SEL_MASK,
  1112. .val = MCIF_SEL_CF,
  1113. },
  1114. };
  1115. static struct spear_modemux cf_modemux[] = {
  1116. {
  1117. .muxregs = cf_muxreg,
  1118. .nmuxregs = ARRAY_SIZE(cf_muxreg),
  1119. },
  1120. };
  1121. static struct spear_pingroup cf_pingroup = {
  1122. .name = "cf_grp",
  1123. .pins = mcif_pins,
  1124. .npins = ARRAY_SIZE(mcif_pins),
  1125. .modemuxs = cf_modemux,
  1126. .nmodemuxs = ARRAY_SIZE(cf_modemux),
  1127. };
  1128. static const char *const cf_grps[] = { "cf_grp" };
  1129. static struct spear_function cf_function = {
  1130. .name = "cf",
  1131. .groups = cf_grps,
  1132. .ngroups = ARRAY_SIZE(cf_grps),
  1133. };
  1134. /* xd device */
  1135. static struct spear_muxreg xd_muxreg[] = {
  1136. MCIF_MUXREG,
  1137. {
  1138. .reg = PERIP_CFG,
  1139. .mask = MCIF_SEL_MASK,
  1140. .val = MCIF_SEL_XD,
  1141. },
  1142. };
  1143. static struct spear_modemux xd_modemux[] = {
  1144. {
  1145. .muxregs = xd_muxreg,
  1146. .nmuxregs = ARRAY_SIZE(xd_muxreg),
  1147. },
  1148. };
  1149. static struct spear_pingroup xd_pingroup = {
  1150. .name = "xd_grp",
  1151. .pins = mcif_pins,
  1152. .npins = ARRAY_SIZE(mcif_pins),
  1153. .modemuxs = xd_modemux,
  1154. .nmodemuxs = ARRAY_SIZE(xd_modemux),
  1155. };
  1156. static const char *const xd_grps[] = { "xd_grp" };
  1157. static struct spear_function xd_function = {
  1158. .name = "xd",
  1159. .groups = xd_grps,
  1160. .ngroups = ARRAY_SIZE(xd_grps),
  1161. };
  1162. /* Pad multiplexing for touch_xy device */
  1163. static const unsigned touch_xy_pins[] = { 97 };
  1164. static struct spear_muxreg touch_xy_muxreg[] = {
  1165. {
  1166. .reg = PAD_FUNCTION_EN_2,
  1167. .mask = PMX_TOUCH_XY_MASK,
  1168. .val = PMX_TOUCH_XY_MASK,
  1169. }, {
  1170. .reg = PAD_DIRECTION_SEL_2,
  1171. .mask = PMX_TOUCH_XY_MASK,
  1172. .val = PMX_TOUCH_XY_MASK,
  1173. },
  1174. };
  1175. static struct spear_modemux touch_xy_modemux[] = {
  1176. {
  1177. .muxregs = touch_xy_muxreg,
  1178. .nmuxregs = ARRAY_SIZE(touch_xy_muxreg),
  1179. },
  1180. };
  1181. static struct spear_pingroup touch_xy_pingroup = {
  1182. .name = "touch_xy_grp",
  1183. .pins = touch_xy_pins,
  1184. .npins = ARRAY_SIZE(touch_xy_pins),
  1185. .modemuxs = touch_xy_modemux,
  1186. .nmodemuxs = ARRAY_SIZE(touch_xy_modemux),
  1187. };
  1188. static const char *const touch_xy_grps[] = { "touch_xy_grp" };
  1189. static struct spear_function touch_xy_function = {
  1190. .name = "touchscreen",
  1191. .groups = touch_xy_grps,
  1192. .ngroups = ARRAY_SIZE(touch_xy_grps),
  1193. };
  1194. /* Pad multiplexing for uart1 device */
  1195. /* Muxed with I2C */
  1196. static const unsigned uart1_dis_i2c_pins[] = { 102, 103 };
  1197. static struct spear_muxreg uart1_dis_i2c_muxreg[] = {
  1198. {
  1199. .reg = PAD_FUNCTION_EN_0,
  1200. .mask = PMX_I2C0_MASK,
  1201. .val = 0,
  1202. }, {
  1203. .reg = PAD_DIRECTION_SEL_0,
  1204. .mask = PMX_I2C0_MASK,
  1205. .val = PMX_I2C0_MASK,
  1206. },
  1207. };
  1208. static struct spear_modemux uart1_dis_i2c_modemux[] = {
  1209. {
  1210. .muxregs = uart1_dis_i2c_muxreg,
  1211. .nmuxregs = ARRAY_SIZE(uart1_dis_i2c_muxreg),
  1212. },
  1213. };
  1214. static struct spear_pingroup uart_1_dis_i2c_pingroup = {
  1215. .name = "uart1_disable_i2c_grp",
  1216. .pins = uart1_dis_i2c_pins,
  1217. .npins = ARRAY_SIZE(uart1_dis_i2c_pins),
  1218. .modemuxs = uart1_dis_i2c_modemux,
  1219. .nmodemuxs = ARRAY_SIZE(uart1_dis_i2c_modemux),
  1220. };
  1221. /* Muxed with SD/MMC */
  1222. static const unsigned uart1_dis_sd_pins[] = { 214, 215 };
  1223. static struct spear_muxreg uart1_dis_sd_muxreg[] = {
  1224. {
  1225. .reg = PAD_FUNCTION_EN_1,
  1226. .mask = PMX_MCIDATA1_MASK |
  1227. PMX_MCIDATA2_MASK,
  1228. .val = 0,
  1229. }, {
  1230. .reg = PAD_DIRECTION_SEL_1,
  1231. .mask = PMX_MCIDATA1_MASK |
  1232. PMX_MCIDATA2_MASK,
  1233. .val = PMX_MCIDATA1_MASK |
  1234. PMX_MCIDATA2_MASK,
  1235. },
  1236. };
  1237. static struct spear_modemux uart1_dis_sd_modemux[] = {
  1238. {
  1239. .muxregs = uart1_dis_sd_muxreg,
  1240. .nmuxregs = ARRAY_SIZE(uart1_dis_sd_muxreg),
  1241. },
  1242. };
  1243. static struct spear_pingroup uart_1_dis_sd_pingroup = {
  1244. .name = "uart1_disable_sd_grp",
  1245. .pins = uart1_dis_sd_pins,
  1246. .npins = ARRAY_SIZE(uart1_dis_sd_pins),
  1247. .modemuxs = uart1_dis_sd_modemux,
  1248. .nmodemuxs = ARRAY_SIZE(uart1_dis_sd_modemux),
  1249. };
  1250. static const char *const uart1_grps[] = { "uart1_disable_i2c_grp",
  1251. "uart1_disable_sd_grp" };
  1252. static struct spear_function uart1_function = {
  1253. .name = "uart1",
  1254. .groups = uart1_grps,
  1255. .ngroups = ARRAY_SIZE(uart1_grps),
  1256. };
  1257. /* Pad multiplexing for uart2_3 device */
  1258. static const unsigned uart2_3_pins[] = { 104, 105, 106, 107 };
  1259. static struct spear_muxreg uart2_3_muxreg[] = {
  1260. {
  1261. .reg = PAD_FUNCTION_EN_0,
  1262. .mask = PMX_I2S0_MASK,
  1263. .val = 0,
  1264. }, {
  1265. .reg = PAD_DIRECTION_SEL_0,
  1266. .mask = PMX_I2S0_MASK,
  1267. .val = PMX_I2S0_MASK,
  1268. },
  1269. };
  1270. static struct spear_modemux uart2_3_modemux[] = {
  1271. {
  1272. .muxregs = uart2_3_muxreg,
  1273. .nmuxregs = ARRAY_SIZE(uart2_3_muxreg),
  1274. },
  1275. };
  1276. static struct spear_pingroup uart_2_3_pingroup = {
  1277. .name = "uart2_3_grp",
  1278. .pins = uart2_3_pins,
  1279. .npins = ARRAY_SIZE(uart2_3_pins),
  1280. .modemuxs = uart2_3_modemux,
  1281. .nmodemuxs = ARRAY_SIZE(uart2_3_modemux),
  1282. };
  1283. static const char *const uart2_3_grps[] = { "uart2_3_grp" };
  1284. static struct spear_function uart2_3_function = {
  1285. .name = "uart2_3",
  1286. .groups = uart2_3_grps,
  1287. .ngroups = ARRAY_SIZE(uart2_3_grps),
  1288. };
  1289. /* Pad multiplexing for uart4 device */
  1290. static const unsigned uart4_pins[] = { 108, 113 };
  1291. static struct spear_muxreg uart4_muxreg[] = {
  1292. {
  1293. .reg = PAD_FUNCTION_EN_0,
  1294. .mask = PMX_I2S0_MASK | PMX_CLCD1_MASK,
  1295. .val = 0,
  1296. }, {
  1297. .reg = PAD_DIRECTION_SEL_0,
  1298. .mask = PMX_I2S0_MASK | PMX_CLCD1_MASK,
  1299. .val = PMX_I2S0_MASK | PMX_CLCD1_MASK,
  1300. },
  1301. };
  1302. static struct spear_modemux uart4_modemux[] = {
  1303. {
  1304. .muxregs = uart4_muxreg,
  1305. .nmuxregs = ARRAY_SIZE(uart4_muxreg),
  1306. },
  1307. };
  1308. static struct spear_pingroup uart_4_pingroup = {
  1309. .name = "uart4_grp",
  1310. .pins = uart4_pins,
  1311. .npins = ARRAY_SIZE(uart4_pins),
  1312. .modemuxs = uart4_modemux,
  1313. .nmodemuxs = ARRAY_SIZE(uart4_modemux),
  1314. };
  1315. static const char *const uart4_grps[] = { "uart4_grp" };
  1316. static struct spear_function uart4_function = {
  1317. .name = "uart4",
  1318. .groups = uart4_grps,
  1319. .ngroups = ARRAY_SIZE(uart4_grps),
  1320. };
  1321. /* Pad multiplexing for uart5 device */
  1322. static const unsigned uart5_pins[] = { 114, 115 };
  1323. static struct spear_muxreg uart5_muxreg[] = {
  1324. {
  1325. .reg = PAD_FUNCTION_EN_0,
  1326. .mask = PMX_CLCD1_MASK,
  1327. .val = 0,
  1328. }, {
  1329. .reg = PAD_DIRECTION_SEL_0,
  1330. .mask = PMX_CLCD1_MASK,
  1331. .val = PMX_CLCD1_MASK,
  1332. },
  1333. };
  1334. static struct spear_modemux uart5_modemux[] = {
  1335. {
  1336. .muxregs = uart5_muxreg,
  1337. .nmuxregs = ARRAY_SIZE(uart5_muxreg),
  1338. },
  1339. };
  1340. static struct spear_pingroup uart_5_pingroup = {
  1341. .name = "uart5_grp",
  1342. .pins = uart5_pins,
  1343. .npins = ARRAY_SIZE(uart5_pins),
  1344. .modemuxs = uart5_modemux,
  1345. .nmodemuxs = ARRAY_SIZE(uart5_modemux),
  1346. };
  1347. static const char *const uart5_grps[] = { "uart5_grp" };
  1348. static struct spear_function uart5_function = {
  1349. .name = "uart5",
  1350. .groups = uart5_grps,
  1351. .ngroups = ARRAY_SIZE(uart5_grps),
  1352. };
  1353. /* Pad multiplexing for rs485_0_1_tdm_0_1 device */
  1354. static const unsigned rs485_0_1_tdm_0_1_pins[] = { 116, 117, 118, 119, 120, 121,
  1355. 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
  1356. 136, 137 };
  1357. static struct spear_muxreg rs485_0_1_tdm_0_1_muxreg[] = {
  1358. {
  1359. .reg = PAD_FUNCTION_EN_0,
  1360. .mask = PMX_CLCD1_MASK,
  1361. .val = 0,
  1362. }, {
  1363. .reg = PAD_DIRECTION_SEL_0,
  1364. .mask = PMX_CLCD1_MASK,
  1365. .val = PMX_CLCD1_MASK,
  1366. },
  1367. };
  1368. static struct spear_modemux rs485_0_1_tdm_0_1_modemux[] = {
  1369. {
  1370. .muxregs = rs485_0_1_tdm_0_1_muxreg,
  1371. .nmuxregs = ARRAY_SIZE(rs485_0_1_tdm_0_1_muxreg),
  1372. },
  1373. };
  1374. static struct spear_pingroup rs485_0_1_tdm_0_1_pingroup = {
  1375. .name = "rs485_0_1_tdm_0_1_grp",
  1376. .pins = rs485_0_1_tdm_0_1_pins,
  1377. .npins = ARRAY_SIZE(rs485_0_1_tdm_0_1_pins),
  1378. .modemuxs = rs485_0_1_tdm_0_1_modemux,
  1379. .nmodemuxs = ARRAY_SIZE(rs485_0_1_tdm_0_1_modemux),
  1380. };
  1381. static const char *const rs485_0_1_tdm_0_1_grps[] = { "rs485_0_1_tdm_0_1_grp" };
  1382. static struct spear_function rs485_0_1_tdm_0_1_function = {
  1383. .name = "rs485_0_1_tdm_0_1",
  1384. .groups = rs485_0_1_tdm_0_1_grps,
  1385. .ngroups = ARRAY_SIZE(rs485_0_1_tdm_0_1_grps),
  1386. };
  1387. /* Pad multiplexing for i2c_1_2 device */
  1388. static const unsigned i2c_1_2_pins[] = { 138, 139, 140, 141 };
  1389. static struct spear_muxreg i2c_1_2_muxreg[] = {
  1390. {
  1391. .reg = PAD_FUNCTION_EN_0,
  1392. .mask = PMX_CLCD1_MASK,
  1393. .val = 0,
  1394. }, {
  1395. .reg = PAD_DIRECTION_SEL_0,
  1396. .mask = PMX_CLCD1_MASK,
  1397. .val = PMX_CLCD1_MASK,
  1398. },
  1399. };
  1400. static struct spear_modemux i2c_1_2_modemux[] = {
  1401. {
  1402. .muxregs = i2c_1_2_muxreg,
  1403. .nmuxregs = ARRAY_SIZE(i2c_1_2_muxreg),
  1404. },
  1405. };
  1406. static struct spear_pingroup i2c_1_2_pingroup = {
  1407. .name = "i2c_1_2_grp",
  1408. .pins = i2c_1_2_pins,
  1409. .npins = ARRAY_SIZE(i2c_1_2_pins),
  1410. .modemuxs = i2c_1_2_modemux,
  1411. .nmodemuxs = ARRAY_SIZE(i2c_1_2_modemux),
  1412. };
  1413. static const char *const i2c_1_2_grps[] = { "i2c_1_2_grp" };
  1414. static struct spear_function i2c_1_2_function = {
  1415. .name = "i2c_1_2",
  1416. .groups = i2c_1_2_grps,
  1417. .ngroups = ARRAY_SIZE(i2c_1_2_grps),
  1418. };
  1419. /* Pad multiplexing for i2c3_dis_smi_clcd device */
  1420. /* Muxed with SMI & CLCD */
  1421. static const unsigned i2c3_dis_smi_clcd_pins[] = { 142, 153 };
  1422. static struct spear_muxreg i2c3_dis_smi_clcd_muxreg[] = {
  1423. {
  1424. .reg = PAD_FUNCTION_EN_0,
  1425. .mask = PMX_CLCD1_MASK | PMX_SMI_MASK,
  1426. .val = 0,
  1427. }, {
  1428. .reg = PAD_DIRECTION_SEL_0,
  1429. .mask = PMX_CLCD1_MASK | PMX_SMI_MASK,
  1430. .val = PMX_CLCD1_MASK | PMX_SMI_MASK,
  1431. },
  1432. };
  1433. static struct spear_modemux i2c3_dis_smi_clcd_modemux[] = {
  1434. {
  1435. .muxregs = i2c3_dis_smi_clcd_muxreg,
  1436. .nmuxregs = ARRAY_SIZE(i2c3_dis_smi_clcd_muxreg),
  1437. },
  1438. };
  1439. static struct spear_pingroup i2c3_dis_smi_clcd_pingroup = {
  1440. .name = "i2c3_dis_smi_clcd_grp",
  1441. .pins = i2c3_dis_smi_clcd_pins,
  1442. .npins = ARRAY_SIZE(i2c3_dis_smi_clcd_pins),
  1443. .modemuxs = i2c3_dis_smi_clcd_modemux,
  1444. .nmodemuxs = ARRAY_SIZE(i2c3_dis_smi_clcd_modemux),
  1445. };
  1446. /* Pad multiplexing for i2c3_dis_sd_i2s0 device */
  1447. /* Muxed with SD/MMC & I2S1 */
  1448. static const unsigned i2c3_dis_sd_i2s0_pins[] = { 0, 216 };
  1449. static struct spear_muxreg i2c3_dis_sd_i2s0_muxreg[] = {
  1450. {
  1451. .reg = PAD_FUNCTION_EN_1,
  1452. .mask = PMX_I2S1_MASK | PMX_MCIDATA3_MASK,
  1453. .val = 0,
  1454. }, {
  1455. .reg = PAD_DIRECTION_SEL_1,
  1456. .mask = PMX_I2S1_MASK | PMX_MCIDATA3_MASK,
  1457. .val = PMX_I2S1_MASK | PMX_MCIDATA3_MASK,
  1458. },
  1459. };
  1460. static struct spear_modemux i2c3_dis_sd_i2s0_modemux[] = {
  1461. {
  1462. .muxregs = i2c3_dis_sd_i2s0_muxreg,
  1463. .nmuxregs = ARRAY_SIZE(i2c3_dis_sd_i2s0_muxreg),
  1464. },
  1465. };
  1466. static struct spear_pingroup i2c3_dis_sd_i2s0_pingroup = {
  1467. .name = "i2c3_dis_sd_i2s0_grp",
  1468. .pins = i2c3_dis_sd_i2s0_pins,
  1469. .npins = ARRAY_SIZE(i2c3_dis_sd_i2s0_pins),
  1470. .modemuxs = i2c3_dis_sd_i2s0_modemux,
  1471. .nmodemuxs = ARRAY_SIZE(i2c3_dis_sd_i2s0_modemux),
  1472. };
  1473. static const char *const i2c3_grps[] = { "i2c3_dis_smi_clcd_grp",
  1474. "i2c3_dis_sd_i2s0_grp" };
  1475. static struct spear_function i2c3_unction = {
  1476. .name = "i2c3_i2s1",
  1477. .groups = i2c3_grps,
  1478. .ngroups = ARRAY_SIZE(i2c3_grps),
  1479. };
  1480. /* Pad multiplexing for i2c_4_5_dis_smi device */
  1481. /* Muxed with SMI */
  1482. static const unsigned i2c_4_5_dis_smi_pins[] = { 154, 155, 156, 157 };
  1483. static struct spear_muxreg i2c_4_5_dis_smi_muxreg[] = {
  1484. {
  1485. .reg = PAD_FUNCTION_EN_0,
  1486. .mask = PMX_SMI_MASK,
  1487. .val = 0,
  1488. }, {
  1489. .reg = PAD_DIRECTION_SEL_0,
  1490. .mask = PMX_SMI_MASK,
  1491. .val = PMX_SMI_MASK,
  1492. },
  1493. };
  1494. static struct spear_modemux i2c_4_5_dis_smi_modemux[] = {
  1495. {
  1496. .muxregs = i2c_4_5_dis_smi_muxreg,
  1497. .nmuxregs = ARRAY_SIZE(i2c_4_5_dis_smi_muxreg),
  1498. },
  1499. };
  1500. static struct spear_pingroup i2c_4_5_dis_smi_pingroup = {
  1501. .name = "i2c_4_5_dis_smi_grp",
  1502. .pins = i2c_4_5_dis_smi_pins,
  1503. .npins = ARRAY_SIZE(i2c_4_5_dis_smi_pins),
  1504. .modemuxs = i2c_4_5_dis_smi_modemux,
  1505. .nmodemuxs = ARRAY_SIZE(i2c_4_5_dis_smi_modemux),
  1506. };
  1507. /* Pad multiplexing for i2c4_dis_sd device */
  1508. /* Muxed with SD/MMC */
  1509. static const unsigned i2c4_dis_sd_pins[] = { 217, 218 };
  1510. static struct spear_muxreg i2c4_dis_sd_muxreg[] = {
  1511. {
  1512. .reg = PAD_FUNCTION_EN_1,
  1513. .mask = PMX_MCIDATA4_MASK,
  1514. .val = 0,
  1515. }, {
  1516. .reg = PAD_FUNCTION_EN_2,
  1517. .mask = PMX_MCIDATA5_MASK,
  1518. .val = 0,
  1519. }, {
  1520. .reg = PAD_DIRECTION_SEL_1,
  1521. .mask = PMX_MCIDATA4_MASK,
  1522. .val = PMX_MCIDATA4_MASK,
  1523. }, {
  1524. .reg = PAD_DIRECTION_SEL_2,
  1525. .mask = PMX_MCIDATA5_MASK,
  1526. .val = PMX_MCIDATA5_MASK,
  1527. },
  1528. };
  1529. static struct spear_modemux i2c4_dis_sd_modemux[] = {
  1530. {
  1531. .muxregs = i2c4_dis_sd_muxreg,
  1532. .nmuxregs = ARRAY_SIZE(i2c4_dis_sd_muxreg),
  1533. },
  1534. };
  1535. static struct spear_pingroup i2c4_dis_sd_pingroup = {
  1536. .name = "i2c4_dis_sd_grp",
  1537. .pins = i2c4_dis_sd_pins,
  1538. .npins = ARRAY_SIZE(i2c4_dis_sd_pins),
  1539. .modemuxs = i2c4_dis_sd_modemux,
  1540. .nmodemuxs = ARRAY_SIZE(i2c4_dis_sd_modemux),
  1541. };
  1542. /* Pad multiplexing for i2c5_dis_sd device */
  1543. /* Muxed with SD/MMC */
  1544. static const unsigned i2c5_dis_sd_pins[] = { 219, 220 };
  1545. static struct spear_muxreg i2c5_dis_sd_muxreg[] = {
  1546. {
  1547. .reg = PAD_FUNCTION_EN_2,
  1548. .mask = PMX_MCIDATA6_MASK |
  1549. PMX_MCIDATA7_MASK,
  1550. .val = 0,
  1551. }, {
  1552. .reg = PAD_DIRECTION_SEL_2,
  1553. .mask = PMX_MCIDATA6_MASK |
  1554. PMX_MCIDATA7_MASK,
  1555. .val = PMX_MCIDATA6_MASK |
  1556. PMX_MCIDATA7_MASK,
  1557. },
  1558. };
  1559. static struct spear_modemux i2c5_dis_sd_modemux[] = {
  1560. {
  1561. .muxregs = i2c5_dis_sd_muxreg,
  1562. .nmuxregs = ARRAY_SIZE(i2c5_dis_sd_muxreg),
  1563. },
  1564. };
  1565. static struct spear_pingroup i2c5_dis_sd_pingroup = {
  1566. .name = "i2c5_dis_sd_grp",
  1567. .pins = i2c5_dis_sd_pins,
  1568. .npins = ARRAY_SIZE(i2c5_dis_sd_pins),
  1569. .modemuxs = i2c5_dis_sd_modemux,
  1570. .nmodemuxs = ARRAY_SIZE(i2c5_dis_sd_modemux),
  1571. };
  1572. static const char *const i2c_4_5_grps[] = { "i2c5_dis_sd_grp",
  1573. "i2c4_dis_sd_grp", "i2c_4_5_dis_smi_grp" };
  1574. static struct spear_function i2c_4_5_function = {
  1575. .name = "i2c_4_5",
  1576. .groups = i2c_4_5_grps,
  1577. .ngroups = ARRAY_SIZE(i2c_4_5_grps),
  1578. };
  1579. /* Pad multiplexing for i2c_6_7_dis_kbd device */
  1580. /* Muxed with KBD */
  1581. static const unsigned i2c_6_7_dis_kbd_pins[] = { 207, 208, 209, 210 };
  1582. static struct spear_muxreg i2c_6_7_dis_kbd_muxreg[] = {
  1583. {
  1584. .reg = PAD_FUNCTION_EN_1,
  1585. .mask = PMX_KBD_ROWCOL25_MASK,
  1586. .val = 0,
  1587. }, {
  1588. .reg = PAD_DIRECTION_SEL_1,
  1589. .mask = PMX_KBD_ROWCOL25_MASK,
  1590. .val = PMX_KBD_ROWCOL25_MASK,
  1591. },
  1592. };
  1593. static struct spear_modemux i2c_6_7_dis_kbd_modemux[] = {
  1594. {
  1595. .muxregs = i2c_6_7_dis_kbd_muxreg,
  1596. .nmuxregs = ARRAY_SIZE(i2c_6_7_dis_kbd_muxreg),
  1597. },
  1598. };
  1599. static struct spear_pingroup i2c_6_7_dis_kbd_pingroup = {
  1600. .name = "i2c_6_7_dis_kbd_grp",
  1601. .pins = i2c_6_7_dis_kbd_pins,
  1602. .npins = ARRAY_SIZE(i2c_6_7_dis_kbd_pins),
  1603. .modemuxs = i2c_6_7_dis_kbd_modemux,
  1604. .nmodemuxs = ARRAY_SIZE(i2c_6_7_dis_kbd_modemux),
  1605. };
  1606. /* Pad multiplexing for i2c6_dis_sd device */
  1607. /* Muxed with SD/MMC */
  1608. static const unsigned i2c6_dis_sd_pins[] = { 236, 237 };
  1609. static struct spear_muxreg i2c6_dis_sd_muxreg[] = {
  1610. {
  1611. .reg = PAD_FUNCTION_EN_2,
  1612. .mask = PMX_MCIIORDRE_MASK |
  1613. PMX_MCIIOWRWE_MASK,
  1614. .val = 0,
  1615. }, {
  1616. .reg = PAD_DIRECTION_SEL_2,
  1617. .mask = PMX_MCIIORDRE_MASK |
  1618. PMX_MCIIOWRWE_MASK,
  1619. .val = PMX_MCIIORDRE_MASK |
  1620. PMX_MCIIOWRWE_MASK,
  1621. },
  1622. };
  1623. static struct spear_modemux i2c6_dis_sd_modemux[] = {
  1624. {
  1625. .muxregs = i2c6_dis_sd_muxreg,
  1626. .nmuxregs = ARRAY_SIZE(i2c6_dis_sd_muxreg),
  1627. },
  1628. };
  1629. static struct spear_pingroup i2c6_dis_sd_pingroup = {
  1630. .name = "i2c6_dis_sd_grp",
  1631. .pins = i2c6_dis_sd_pins,
  1632. .npins = ARRAY_SIZE(i2c6_dis_sd_pins),
  1633. .modemuxs = i2c6_dis_sd_modemux,
  1634. .nmodemuxs = ARRAY_SIZE(i2c6_dis_sd_modemux),
  1635. };
  1636. /* Pad multiplexing for i2c7_dis_sd device */
  1637. static const unsigned i2c7_dis_sd_pins[] = { 238, 239 };
  1638. static struct spear_muxreg i2c7_dis_sd_muxreg[] = {
  1639. {
  1640. .reg = PAD_FUNCTION_EN_2,
  1641. .mask = PMX_MCIRESETCF_MASK |
  1642. PMX_MCICS0CE_MASK,
  1643. .val = 0,
  1644. }, {
  1645. .reg = PAD_DIRECTION_SEL_2,
  1646. .mask = PMX_MCIRESETCF_MASK |
  1647. PMX_MCICS0CE_MASK,
  1648. .val = PMX_MCIRESETCF_MASK |
  1649. PMX_MCICS0CE_MASK,
  1650. },
  1651. };
  1652. static struct spear_modemux i2c7_dis_sd_modemux[] = {
  1653. {
  1654. .muxregs = i2c7_dis_sd_muxreg,
  1655. .nmuxregs = ARRAY_SIZE(i2c7_dis_sd_muxreg),
  1656. },
  1657. };
  1658. static struct spear_pingroup i2c7_dis_sd_pingroup = {
  1659. .name = "i2c7_dis_sd_grp",
  1660. .pins = i2c7_dis_sd_pins,
  1661. .npins = ARRAY_SIZE(i2c7_dis_sd_pins),
  1662. .modemuxs = i2c7_dis_sd_modemux,
  1663. .nmodemuxs = ARRAY_SIZE(i2c7_dis_sd_modemux),
  1664. };
  1665. static const char *const i2c_6_7_grps[] = { "i2c6_dis_sd_grp",
  1666. "i2c7_dis_sd_grp", "i2c_6_7_dis_kbd_grp" };
  1667. static struct spear_function i2c_6_7_function = {
  1668. .name = "i2c_6_7",
  1669. .groups = i2c_6_7_grps,
  1670. .ngroups = ARRAY_SIZE(i2c_6_7_grps),
  1671. };
  1672. /* Pad multiplexing for can0_dis_nor device */
  1673. /* Muxed with NOR */
  1674. static const unsigned can0_dis_nor_pins[] = { 56, 57 };
  1675. static struct spear_muxreg can0_dis_nor_muxreg[] = {
  1676. {
  1677. .reg = PAD_FUNCTION_EN_0,
  1678. .mask = PMX_NFRSTPWDWN2_MASK,
  1679. .val = 0,
  1680. }, {
  1681. .reg = PAD_FUNCTION_EN_1,
  1682. .mask = PMX_NFRSTPWDWN3_MASK,
  1683. .val = 0,
  1684. }, {
  1685. .reg = PAD_DIRECTION_SEL_0,
  1686. .mask = PMX_NFRSTPWDWN2_MASK,
  1687. .val = PMX_NFRSTPWDWN2_MASK,
  1688. }, {
  1689. .reg = PAD_DIRECTION_SEL_1,
  1690. .mask = PMX_NFRSTPWDWN3_MASK,
  1691. .val = PMX_NFRSTPWDWN3_MASK,
  1692. },
  1693. };
  1694. static struct spear_modemux can0_dis_nor_modemux[] = {
  1695. {
  1696. .muxregs = can0_dis_nor_muxreg,
  1697. .nmuxregs = ARRAY_SIZE(can0_dis_nor_muxreg),
  1698. },
  1699. };
  1700. static struct spear_pingroup can0_dis_nor_pingroup = {
  1701. .name = "can0_dis_nor_grp",
  1702. .pins = can0_dis_nor_pins,
  1703. .npins = ARRAY_SIZE(can0_dis_nor_pins),
  1704. .modemuxs = can0_dis_nor_modemux,
  1705. .nmodemuxs = ARRAY_SIZE(can0_dis_nor_modemux),
  1706. };
  1707. /* Pad multiplexing for can0_dis_sd device */
  1708. /* Muxed with SD/MMC */
  1709. static const unsigned can0_dis_sd_pins[] = { 240, 241 };
  1710. static struct spear_muxreg can0_dis_sd_muxreg[] = {
  1711. {
  1712. .reg = PAD_FUNCTION_EN_2,
  1713. .mask = PMX_MCICFINTR_MASK | PMX_MCIIORDY_MASK,
  1714. .val = 0,
  1715. }, {
  1716. .reg = PAD_DIRECTION_SEL_2,
  1717. .mask = PMX_MCICFINTR_MASK | PMX_MCIIORDY_MASK,
  1718. .val = PMX_MCICFINTR_MASK | PMX_MCIIORDY_MASK,
  1719. },
  1720. };
  1721. static struct spear_modemux can0_dis_sd_modemux[] = {
  1722. {
  1723. .muxregs = can0_dis_sd_muxreg,
  1724. .nmuxregs = ARRAY_SIZE(can0_dis_sd_muxreg),
  1725. },
  1726. };
  1727. static struct spear_pingroup can0_dis_sd_pingroup = {
  1728. .name = "can0_dis_sd_grp",
  1729. .pins = can0_dis_sd_pins,
  1730. .npins = ARRAY_SIZE(can0_dis_sd_pins),
  1731. .modemuxs = can0_dis_sd_modemux,
  1732. .nmodemuxs = ARRAY_SIZE(can0_dis_sd_modemux),
  1733. };
  1734. static const char *const can0_grps[] = { "can0_dis_nor_grp", "can0_dis_sd_grp"
  1735. };
  1736. static struct spear_function can0_function = {
  1737. .name = "can0",
  1738. .groups = can0_grps,
  1739. .ngroups = ARRAY_SIZE(can0_grps),
  1740. };
  1741. /* Pad multiplexing for can1_dis_sd device */
  1742. /* Muxed with SD/MMC */
  1743. static const unsigned can1_dis_sd_pins[] = { 242, 243 };
  1744. static struct spear_muxreg can1_dis_sd_muxreg[] = {
  1745. {
  1746. .reg = PAD_FUNCTION_EN_2,
  1747. .mask = PMX_MCICS1_MASK | PMX_MCIDMAACK_MASK,
  1748. .val = 0,
  1749. }, {
  1750. .reg = PAD_DIRECTION_SEL_2,
  1751. .mask = PMX_MCICS1_MASK | PMX_MCIDMAACK_MASK,
  1752. .val = PMX_MCICS1_MASK | PMX_MCIDMAACK_MASK,
  1753. },
  1754. };
  1755. static struct spear_modemux can1_dis_sd_modemux[] = {
  1756. {
  1757. .muxregs = can1_dis_sd_muxreg,
  1758. .nmuxregs = ARRAY_SIZE(can1_dis_sd_muxreg),
  1759. },
  1760. };
  1761. static struct spear_pingroup can1_dis_sd_pingroup = {
  1762. .name = "can1_dis_sd_grp",
  1763. .pins = can1_dis_sd_pins,
  1764. .npins = ARRAY_SIZE(can1_dis_sd_pins),
  1765. .modemuxs = can1_dis_sd_modemux,
  1766. .nmodemuxs = ARRAY_SIZE(can1_dis_sd_modemux),
  1767. };
  1768. /* Pad multiplexing for can1_dis_kbd device */
  1769. /* Muxed with KBD */
  1770. static const unsigned can1_dis_kbd_pins[] = { 201, 202 };
  1771. static struct spear_muxreg can1_dis_kbd_muxreg[] = {
  1772. {
  1773. .reg = PAD_FUNCTION_EN_1,
  1774. .mask = PMX_KBD_ROWCOL25_MASK,
  1775. .val = 0,
  1776. }, {
  1777. .reg = PAD_DIRECTION_SEL_1,
  1778. .mask = PMX_KBD_ROWCOL25_MASK,
  1779. .val = PMX_KBD_ROWCOL25_MASK,
  1780. },
  1781. };
  1782. static struct spear_modemux can1_dis_kbd_modemux[] = {
  1783. {
  1784. .muxregs = can1_dis_kbd_muxreg,
  1785. .nmuxregs = ARRAY_SIZE(can1_dis_kbd_muxreg),
  1786. },
  1787. };
  1788. static struct spear_pingroup can1_dis_kbd_pingroup = {
  1789. .name = "can1_dis_kbd_grp",
  1790. .pins = can1_dis_kbd_pins,
  1791. .npins = ARRAY_SIZE(can1_dis_kbd_pins),
  1792. .modemuxs = can1_dis_kbd_modemux,
  1793. .nmodemuxs = ARRAY_SIZE(can1_dis_kbd_modemux),
  1794. };
  1795. static const char *const can1_grps[] = { "can1_dis_sd_grp", "can1_dis_kbd_grp"
  1796. };
  1797. static struct spear_function can1_function = {
  1798. .name = "can1",
  1799. .groups = can1_grps,
  1800. .ngroups = ARRAY_SIZE(can1_grps),
  1801. };
  1802. /* Pad multiplexing for (ras-ip) pci device */
  1803. static const unsigned pci_pins[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 18,
  1804. 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
  1805. 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
  1806. 55, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 };
  1807. static struct spear_muxreg pci_muxreg[] = {
  1808. {
  1809. .reg = PAD_FUNCTION_EN_0,
  1810. .mask = PMX_MCI_DATA8_15_MASK,
  1811. .val = 0,
  1812. }, {
  1813. .reg = PAD_FUNCTION_EN_1,
  1814. .mask = PMX_PCI_REG1_MASK,
  1815. .val = 0,
  1816. }, {
  1817. .reg = PAD_FUNCTION_EN_2,
  1818. .mask = PMX_PCI_REG2_MASK,
  1819. .val = 0,
  1820. }, {
  1821. .reg = PAD_DIRECTION_SEL_0,
  1822. .mask = PMX_MCI_DATA8_15_MASK,
  1823. .val = PMX_MCI_DATA8_15_MASK,
  1824. }, {
  1825. .reg = PAD_DIRECTION_SEL_1,
  1826. .mask = PMX_PCI_REG1_MASK,
  1827. .val = PMX_PCI_REG1_MASK,
  1828. }, {
  1829. .reg = PAD_DIRECTION_SEL_2,
  1830. .mask = PMX_PCI_REG2_MASK,
  1831. .val = PMX_PCI_REG2_MASK,
  1832. },
  1833. };
  1834. static struct spear_modemux pci_modemux[] = {
  1835. {
  1836. .muxregs = pci_muxreg,
  1837. .nmuxregs = ARRAY_SIZE(pci_muxreg),
  1838. },
  1839. };
  1840. static struct spear_pingroup pci_pingroup = {
  1841. .name = "pci_grp",
  1842. .pins = pci_pins,
  1843. .npins = ARRAY_SIZE(pci_pins),
  1844. .modemuxs = pci_modemux,
  1845. .nmodemuxs = ARRAY_SIZE(pci_modemux),
  1846. };
  1847. static const char *const pci_grps[] = { "pci_grp" };
  1848. static struct spear_function pci_function = {
  1849. .name = "pci",
  1850. .groups = pci_grps,
  1851. .ngroups = ARRAY_SIZE(pci_grps),
  1852. };
  1853. /* pad multiplexing for (fix-part) pcie0 device */
  1854. static struct spear_muxreg pcie0_muxreg[] = {
  1855. {
  1856. .reg = PCIE_SATA_CFG,
  1857. .mask = PCIE_CFG_VAL(0),
  1858. .val = PCIE_CFG_VAL(0),
  1859. },
  1860. };
  1861. static struct spear_modemux pcie0_modemux[] = {
  1862. {
  1863. .muxregs = pcie0_muxreg,
  1864. .nmuxregs = ARRAY_SIZE(pcie0_muxreg),
  1865. },
  1866. };
  1867. static struct spear_pingroup pcie0_pingroup = {
  1868. .name = "pcie0_grp",
  1869. .modemuxs = pcie0_modemux,
  1870. .nmodemuxs = ARRAY_SIZE(pcie0_modemux),
  1871. };
  1872. /* pad multiplexing for (fix-part) pcie1 device */
  1873. static struct spear_muxreg pcie1_muxreg[] = {
  1874. {
  1875. .reg = PCIE_SATA_CFG,
  1876. .mask = PCIE_CFG_VAL(1),
  1877. .val = PCIE_CFG_VAL(1),
  1878. },
  1879. };
  1880. static struct spear_modemux pcie1_modemux[] = {
  1881. {
  1882. .muxregs = pcie1_muxreg,
  1883. .nmuxregs = ARRAY_SIZE(pcie1_muxreg),
  1884. },
  1885. };
  1886. static struct spear_pingroup pcie1_pingroup = {
  1887. .name = "pcie1_grp",
  1888. .modemuxs = pcie1_modemux,
  1889. .nmodemuxs = ARRAY_SIZE(pcie1_modemux),
  1890. };
  1891. /* pad multiplexing for (fix-part) pcie2 device */
  1892. static struct spear_muxreg pcie2_muxreg[] = {
  1893. {
  1894. .reg = PCIE_SATA_CFG,
  1895. .mask = PCIE_CFG_VAL(2),
  1896. .val = PCIE_CFG_VAL(2),
  1897. },
  1898. };
  1899. static struct spear_modemux pcie2_modemux[] = {
  1900. {
  1901. .muxregs = pcie2_muxreg,
  1902. .nmuxregs = ARRAY_SIZE(pcie2_muxreg),
  1903. },
  1904. };
  1905. static struct spear_pingroup pcie2_pingroup = {
  1906. .name = "pcie2_grp",
  1907. .modemuxs = pcie2_modemux,
  1908. .nmodemuxs = ARRAY_SIZE(pcie2_modemux),
  1909. };
  1910. static const char *const pcie_grps[] = { "pcie0_grp", "pcie1_grp", "pcie2_grp"
  1911. };
  1912. static struct spear_function pcie_function = {
  1913. .name = "pci_express",
  1914. .groups = pcie_grps,
  1915. .ngroups = ARRAY_SIZE(pcie_grps),
  1916. };
  1917. /* pad multiplexing for sata0 device */
  1918. static struct spear_muxreg sata0_muxreg[] = {
  1919. {
  1920. .reg = PCIE_SATA_CFG,
  1921. .mask = SATA_CFG_VAL(0),
  1922. .val = SATA_CFG_VAL(0),
  1923. },
  1924. };
  1925. static struct spear_modemux sata0_modemux[] = {
  1926. {
  1927. .muxregs = sata0_muxreg,
  1928. .nmuxregs = ARRAY_SIZE(sata0_muxreg),
  1929. },
  1930. };
  1931. static struct spear_pingroup sata0_pingroup = {
  1932. .name = "sata0_grp",
  1933. .modemuxs = sata0_modemux,
  1934. .nmodemuxs = ARRAY_SIZE(sata0_modemux),
  1935. };
  1936. /* pad multiplexing for sata1 device */
  1937. static struct spear_muxreg sata1_muxreg[] = {
  1938. {
  1939. .reg = PCIE_SATA_CFG,
  1940. .mask = SATA_CFG_VAL(1),
  1941. .val = SATA_CFG_VAL(1),
  1942. },
  1943. };
  1944. static struct spear_modemux sata1_modemux[] = {
  1945. {
  1946. .muxregs = sata1_muxreg,
  1947. .nmuxregs = ARRAY_SIZE(sata1_muxreg),
  1948. },
  1949. };
  1950. static struct spear_pingroup sata1_pingroup = {
  1951. .name = "sata1_grp",
  1952. .modemuxs = sata1_modemux,
  1953. .nmodemuxs = ARRAY_SIZE(sata1_modemux),
  1954. };
  1955. /* pad multiplexing for sata2 device */
  1956. static struct spear_muxreg sata2_muxreg[] = {
  1957. {
  1958. .reg = PCIE_SATA_CFG,
  1959. .mask = SATA_CFG_VAL(2),
  1960. .val = SATA_CFG_VAL(2),
  1961. },
  1962. };
  1963. static struct spear_modemux sata2_modemux[] = {
  1964. {
  1965. .muxregs = sata2_muxreg,
  1966. .nmuxregs = ARRAY_SIZE(sata2_muxreg),
  1967. },
  1968. };
  1969. static struct spear_pingroup sata2_pingroup = {
  1970. .name = "sata2_grp",
  1971. .modemuxs = sata2_modemux,
  1972. .nmodemuxs = ARRAY_SIZE(sata2_modemux),
  1973. };
  1974. static const char *const sata_grps[] = { "sata0_grp", "sata1_grp", "sata2_grp"
  1975. };
  1976. static struct spear_function sata_function = {
  1977. .name = "sata",
  1978. .groups = sata_grps,
  1979. .ngroups = ARRAY_SIZE(sata_grps),
  1980. };
  1981. /* Pad multiplexing for ssp1_dis_kbd device */
  1982. static const unsigned ssp1_dis_kbd_pins[] = { 203, 204, 205, 206 };
  1983. static struct spear_muxreg ssp1_dis_kbd_muxreg[] = {
  1984. {
  1985. .reg = PAD_FUNCTION_EN_1,
  1986. .mask = PMX_KBD_ROWCOL25_MASK | PMX_KBD_COL1_MASK |
  1987. PMX_KBD_COL0_MASK | PMX_NFIO8_15_MASK | PMX_NFCE1_MASK |
  1988. PMX_NFCE2_MASK,
  1989. .val = 0,
  1990. }, {
  1991. .reg = PAD_DIRECTION_SEL_1,
  1992. .mask = PMX_KBD_ROWCOL25_MASK | PMX_KBD_COL1_MASK |
  1993. PMX_KBD_COL0_MASK | PMX_NFIO8_15_MASK | PMX_NFCE1_MASK |
  1994. PMX_NFCE2_MASK,
  1995. .val = PMX_KBD_ROWCOL25_MASK | PMX_KBD_COL1_MASK |
  1996. PMX_KBD_COL0_MASK | PMX_NFIO8_15_MASK | PMX_NFCE1_MASK |
  1997. PMX_NFCE2_MASK,
  1998. },
  1999. };
  2000. static struct spear_modemux ssp1_dis_kbd_modemux[] = {
  2001. {
  2002. .muxregs = ssp1_dis_kbd_muxreg,
  2003. .nmuxregs = ARRAY_SIZE(ssp1_dis_kbd_muxreg),
  2004. },
  2005. };
  2006. static struct spear_pingroup ssp1_dis_kbd_pingroup = {
  2007. .name = "ssp1_dis_kbd_grp",
  2008. .pins = ssp1_dis_kbd_pins,
  2009. .npins = ARRAY_SIZE(ssp1_dis_kbd_pins),
  2010. .modemuxs = ssp1_dis_kbd_modemux,
  2011. .nmodemuxs = ARRAY_SIZE(ssp1_dis_kbd_modemux),
  2012. };
  2013. /* Pad multiplexing for ssp1_dis_sd device */
  2014. static const unsigned ssp1_dis_sd_pins[] = { 224, 226, 227, 228 };
  2015. static struct spear_muxreg ssp1_dis_sd_muxreg[] = {
  2016. {
  2017. .reg = PAD_FUNCTION_EN_2,
  2018. .mask = PMX_MCIADDR0ALE_MASK | PMX_MCIADDR2_MASK |
  2019. PMX_MCICECF_MASK | PMX_MCICEXD_MASK,
  2020. .val = 0,
  2021. }, {
  2022. .reg = PAD_DIRECTION_SEL_2,
  2023. .mask = PMX_MCIADDR0ALE_MASK | PMX_MCIADDR2_MASK |
  2024. PMX_MCICECF_MASK | PMX_MCICEXD_MASK,
  2025. .val = PMX_MCIADDR0ALE_MASK | PMX_MCIADDR2_MASK |
  2026. PMX_MCICECF_MASK | PMX_MCICEXD_MASK,
  2027. },
  2028. };
  2029. static struct spear_modemux ssp1_dis_sd_modemux[] = {
  2030. {
  2031. .muxregs = ssp1_dis_sd_muxreg,
  2032. .nmuxregs = ARRAY_SIZE(ssp1_dis_sd_muxreg),
  2033. },
  2034. };
  2035. static struct spear_pingroup ssp1_dis_sd_pingroup = {
  2036. .name = "ssp1_dis_sd_grp",
  2037. .pins = ssp1_dis_sd_pins,
  2038. .npins = ARRAY_SIZE(ssp1_dis_sd_pins),
  2039. .modemuxs = ssp1_dis_sd_modemux,
  2040. .nmodemuxs = ARRAY_SIZE(ssp1_dis_sd_modemux),
  2041. };
  2042. static const char *const ssp1_grps[] = { "ssp1_dis_kbd_grp",
  2043. "ssp1_dis_sd_grp" };
  2044. static struct spear_function ssp1_function = {
  2045. .name = "ssp1",
  2046. .groups = ssp1_grps,
  2047. .ngroups = ARRAY_SIZE(ssp1_grps),
  2048. };
  2049. /* Pad multiplexing for gpt64 device */
  2050. static const unsigned gpt64_pins[] = { 230, 231, 232, 245 };
  2051. static struct spear_muxreg gpt64_muxreg[] = {
  2052. {
  2053. .reg = PAD_FUNCTION_EN_2,
  2054. .mask = PMX_MCICDCF1_MASK | PMX_MCICDCF2_MASK | PMX_MCICDXD_MASK
  2055. | PMX_MCILEDS_MASK,
  2056. .val = 0,
  2057. }, {
  2058. .reg = PAD_DIRECTION_SEL_2,
  2059. .mask = PMX_MCICDCF1_MASK | PMX_MCICDCF2_MASK | PMX_MCICDXD_MASK
  2060. | PMX_MCILEDS_MASK,
  2061. .val = PMX_MCICDCF1_MASK | PMX_MCICDCF2_MASK | PMX_MCICDXD_MASK
  2062. | PMX_MCILEDS_MASK,
  2063. },
  2064. };
  2065. static struct spear_modemux gpt64_modemux[] = {
  2066. {
  2067. .muxregs = gpt64_muxreg,
  2068. .nmuxregs = ARRAY_SIZE(gpt64_muxreg),
  2069. },
  2070. };
  2071. static struct spear_pingroup gpt64_pingroup = {
  2072. .name = "gpt64_grp",
  2073. .pins = gpt64_pins,
  2074. .npins = ARRAY_SIZE(gpt64_pins),
  2075. .modemuxs = gpt64_modemux,
  2076. .nmodemuxs = ARRAY_SIZE(gpt64_modemux),
  2077. };
  2078. static const char *const gpt64_grps[] = { "gpt64_grp" };
  2079. static struct spear_function gpt64_function = {
  2080. .name = "gpt64",
  2081. .groups = gpt64_grps,
  2082. .ngroups = ARRAY_SIZE(gpt64_grps),
  2083. };
  2084. /* pingroups */
  2085. static struct spear_pingroup *spear1310_pingroups[] = {
  2086. &i2c0_pingroup,
  2087. &ssp0_pingroup,
  2088. &i2s0_pingroup,
  2089. &i2s1_pingroup,
  2090. &clcd_pingroup,
  2091. &clcd_high_res_pingroup,
  2092. &arm_gpio_pingroup,
  2093. &smi_2_chips_pingroup,
  2094. &smi_4_chips_pingroup,
  2095. &gmii_pingroup,
  2096. &rgmii_pingroup,
  2097. &smii_0_1_2_pingroup,
  2098. &ras_mii_txclk_pingroup,
  2099. &nand_8bit_pingroup,
  2100. &nand_16bit_pingroup,
  2101. &nand_4_chips_pingroup,
  2102. &keyboard_6x6_pingroup,
  2103. &keyboard_rowcol6_8_pingroup,
  2104. &uart0_pingroup,
  2105. &uart0_modem_pingroup,
  2106. &gpt0_tmr0_pingroup,
  2107. &gpt0_tmr1_pingroup,
  2108. &gpt1_tmr0_pingroup,
  2109. &gpt1_tmr1_pingroup,
  2110. &sdhci_pingroup,
  2111. &cf_pingroup,
  2112. &xd_pingroup,
  2113. &touch_xy_pingroup,
  2114. &ssp0_cs0_pingroup,
  2115. &ssp0_cs1_2_pingroup,
  2116. &uart_1_dis_i2c_pingroup,
  2117. &uart_1_dis_sd_pingroup,
  2118. &uart_2_3_pingroup,
  2119. &uart_4_pingroup,
  2120. &uart_5_pingroup,
  2121. &rs485_0_1_tdm_0_1_pingroup,
  2122. &i2c_1_2_pingroup,
  2123. &i2c3_dis_smi_clcd_pingroup,
  2124. &i2c3_dis_sd_i2s0_pingroup,
  2125. &i2c_4_5_dis_smi_pingroup,
  2126. &i2c4_dis_sd_pingroup,
  2127. &i2c5_dis_sd_pingroup,
  2128. &i2c_6_7_dis_kbd_pingroup,
  2129. &i2c6_dis_sd_pingroup,
  2130. &i2c7_dis_sd_pingroup,
  2131. &can0_dis_nor_pingroup,
  2132. &can0_dis_sd_pingroup,
  2133. &can1_dis_sd_pingroup,
  2134. &can1_dis_kbd_pingroup,
  2135. &pci_pingroup,
  2136. &pcie0_pingroup,
  2137. &pcie1_pingroup,
  2138. &pcie2_pingroup,
  2139. &sata0_pingroup,
  2140. &sata1_pingroup,
  2141. &sata2_pingroup,
  2142. &ssp1_dis_kbd_pingroup,
  2143. &ssp1_dis_sd_pingroup,
  2144. &gpt64_pingroup,
  2145. };
  2146. /* functions */
  2147. static struct spear_function *spear1310_functions[] = {
  2148. &i2c0_function,
  2149. &ssp0_function,
  2150. &i2s0_function,
  2151. &i2s1_function,
  2152. &clcd_function,
  2153. &arm_gpio_function,
  2154. &smi_function,
  2155. &gmii_function,
  2156. &rgmii_function,
  2157. &smii_0_1_2_function,
  2158. &ras_mii_txclk_function,
  2159. &nand_function,
  2160. &keyboard_function,
  2161. &uart0_function,
  2162. &gpt0_function,
  2163. &gpt1_function,
  2164. &sdhci_function,
  2165. &cf_function,
  2166. &xd_function,
  2167. &touch_xy_function,
  2168. &uart1_function,
  2169. &uart2_3_function,
  2170. &uart4_function,
  2171. &uart5_function,
  2172. &rs485_0_1_tdm_0_1_function,
  2173. &i2c_1_2_function,
  2174. &i2c3_unction,
  2175. &i2c_4_5_function,
  2176. &i2c_6_7_function,
  2177. &can0_function,
  2178. &can1_function,
  2179. &pci_function,
  2180. &pcie_function,
  2181. &sata_function,
  2182. &ssp1_function,
  2183. &gpt64_function,
  2184. };
  2185. static const unsigned pin18[] = { 18, };
  2186. static const unsigned pin19[] = { 19, };
  2187. static const unsigned pin20[] = { 20, };
  2188. static const unsigned pin21[] = { 21, };
  2189. static const unsigned pin22[] = { 22, };
  2190. static const unsigned pin23[] = { 23, };
  2191. static const unsigned pin54[] = { 54, };
  2192. static const unsigned pin55[] = { 55, };
  2193. static const unsigned pin56[] = { 56, };
  2194. static const unsigned pin57[] = { 57, };
  2195. static const unsigned pin58[] = { 58, };
  2196. static const unsigned pin59[] = { 59, };
  2197. static const unsigned pin60[] = { 60, };
  2198. static const unsigned pin61[] = { 61, };
  2199. static const unsigned pin62[] = { 62, };
  2200. static const unsigned pin63[] = { 63, };
  2201. static const unsigned pin143[] = { 143, };
  2202. static const unsigned pin144[] = { 144, };
  2203. static const unsigned pin145[] = { 145, };
  2204. static const unsigned pin146[] = { 146, };
  2205. static const unsigned pin147[] = { 147, };
  2206. static const unsigned pin148[] = { 148, };
  2207. static const unsigned pin149[] = { 149, };
  2208. static const unsigned pin150[] = { 150, };
  2209. static const unsigned pin151[] = { 151, };
  2210. static const unsigned pin152[] = { 152, };
  2211. static const unsigned pin205[] = { 205, };
  2212. static const unsigned pin206[] = { 206, };
  2213. static const unsigned pin211[] = { 211, };
  2214. static const unsigned pin212[] = { 212, };
  2215. static const unsigned pin213[] = { 213, };
  2216. static const unsigned pin214[] = { 214, };
  2217. static const unsigned pin215[] = { 215, };
  2218. static const unsigned pin216[] = { 216, };
  2219. static const unsigned pin217[] = { 217, };
  2220. static const unsigned pin218[] = { 218, };
  2221. static const unsigned pin219[] = { 219, };
  2222. static const unsigned pin220[] = { 220, };
  2223. static const unsigned pin221[] = { 221, };
  2224. static const unsigned pin222[] = { 222, };
  2225. static const unsigned pin223[] = { 223, };
  2226. static const unsigned pin224[] = { 224, };
  2227. static const unsigned pin225[] = { 225, };
  2228. static const unsigned pin226[] = { 226, };
  2229. static const unsigned pin227[] = { 227, };
  2230. static const unsigned pin228[] = { 228, };
  2231. static const unsigned pin229[] = { 229, };
  2232. static const unsigned pin230[] = { 230, };
  2233. static const unsigned pin231[] = { 231, };
  2234. static const unsigned pin232[] = { 232, };
  2235. static const unsigned pin233[] = { 233, };
  2236. static const unsigned pin234[] = { 234, };
  2237. static const unsigned pin235[] = { 235, };
  2238. static const unsigned pin236[] = { 236, };
  2239. static const unsigned pin237[] = { 237, };
  2240. static const unsigned pin238[] = { 238, };
  2241. static const unsigned pin239[] = { 239, };
  2242. static const unsigned pin240[] = { 240, };
  2243. static const unsigned pin241[] = { 241, };
  2244. static const unsigned pin242[] = { 242, };
  2245. static const unsigned pin243[] = { 243, };
  2246. static const unsigned pin244[] = { 244, };
  2247. static const unsigned pin245[] = { 245, };
  2248. static const unsigned pin_grp0[] = { 173, 174, };
  2249. static const unsigned pin_grp1[] = { 175, 185, 188, 197, 198, };
  2250. static const unsigned pin_grp2[] = { 176, 177, 178, 179, 184, 186, 187, 189,
  2251. 190, 191, 192, };
  2252. static const unsigned pin_grp3[] = { 180, 181, 182, 183, 193, 194, 195, 196, };
  2253. static const unsigned pin_grp4[] = { 199, 200, };
  2254. static const unsigned pin_grp5[] = { 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
  2255. 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, };
  2256. static const unsigned pin_grp6[] = { 86, 87, 88, 89, 90, 91, 92, 93, };
  2257. static const unsigned pin_grp7[] = { 98, 99, };
  2258. static const unsigned pin_grp8[] = { 158, 159, 160, 161, 162, 163, 164, 165,
  2259. 166, 167, 168, 169, 170, 171, 172, };
  2260. /* Define muxreg arrays */
  2261. DEFINE_2_MUXREG(i2c0_pins, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_I2C0_MASK, 0, 1);
  2262. DEFINE_2_MUXREG(ssp0_pins, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_SSP0_MASK, 0, 1);
  2263. DEFINE_2_MUXREG(ssp0_cs0_pins, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_SSP0_CS0_MASK, 0, 1);
  2264. DEFINE_2_MUXREG(ssp0_cs1_2_pins, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_SSP0_CS1_2_MASK, 0, 1);
  2265. DEFINE_2_MUXREG(i2s0_pins, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_I2S0_MASK, 0, 1);
  2266. DEFINE_2_MUXREG(i2s1_pins, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_I2S1_MASK, 0, 1);
  2267. DEFINE_2_MUXREG(clcd_pins, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_CLCD1_MASK, 0, 1);
  2268. DEFINE_2_MUXREG(clcd_high_res_pins, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_CLCD2_MASK, 0, 1);
  2269. DEFINE_2_MUXREG(pin18, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO15_MASK, 0, 1);
  2270. DEFINE_2_MUXREG(pin19, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO14_MASK, 0, 1);
  2271. DEFINE_2_MUXREG(pin20, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO13_MASK, 0, 1);
  2272. DEFINE_2_MUXREG(pin21, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO12_MASK, 0, 1);
  2273. DEFINE_2_MUXREG(pin22, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO11_MASK, 0, 1);
  2274. DEFINE_2_MUXREG(pin23, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO10_MASK, 0, 1);
  2275. DEFINE_2_MUXREG(pin143, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO00_MASK, 0, 1);
  2276. DEFINE_2_MUXREG(pin144, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO01_MASK, 0, 1);
  2277. DEFINE_2_MUXREG(pin145, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO02_MASK, 0, 1);
  2278. DEFINE_2_MUXREG(pin146, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO03_MASK, 0, 1);
  2279. DEFINE_2_MUXREG(pin147, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO04_MASK, 0, 1);
  2280. DEFINE_2_MUXREG(pin148, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO05_MASK, 0, 1);
  2281. DEFINE_2_MUXREG(pin149, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO06_MASK, 0, 1);
  2282. DEFINE_2_MUXREG(pin150, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO07_MASK, 0, 1);
  2283. DEFINE_2_MUXREG(pin151, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO08_MASK, 0, 1);
  2284. DEFINE_2_MUXREG(pin152, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_EGPIO09_MASK, 0, 1);
  2285. DEFINE_2_MUXREG(smi_2_chips_pins, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_SMI_MASK, 0, 1);
  2286. DEFINE_2_MUXREG(pin54, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_SMINCS3_MASK, 0, 1);
  2287. DEFINE_2_MUXREG(pin55, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_SMINCS2_MASK, 0, 1);
  2288. DEFINE_2_MUXREG(pin56, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_NFRSTPWDWN3_MASK, 0, 1);
  2289. DEFINE_2_MUXREG(pin57, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_NFRSTPWDWN2_MASK, 0, 1);
  2290. DEFINE_2_MUXREG(pin58, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_NFRSTPWDWN1_MASK, 0, 1);
  2291. DEFINE_2_MUXREG(pin59, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_NFRSTPWDWN0_MASK, 0, 1);
  2292. DEFINE_2_MUXREG(pin60, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_NFWPRT3_MASK, 0, 1);
  2293. DEFINE_2_MUXREG(pin61, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_NFCE3_MASK, 0, 1);
  2294. DEFINE_2_MUXREG(pin62, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_NFAD25_MASK, 0, 1);
  2295. DEFINE_2_MUXREG(pin63, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_NFAD24_MASK, 0, 1);
  2296. DEFINE_2_MUXREG(pin_grp0, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_GMIICLK_MASK, 0, 1);
  2297. DEFINE_2_MUXREG(pin_grp1, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_GMIICOL_CRS_XFERER_MIITXCLK_MASK, 0, 1);
  2298. DEFINE_2_MUXREG(pin_grp2, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_RXCLK_RDV_TXEN_D03_MASK, 0, 1);
  2299. DEFINE_2_MUXREG(pin_grp3, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_GMIID47_MASK, 0, 1);
  2300. DEFINE_2_MUXREG(pin_grp4, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_MDC_MDIO_MASK, 0, 1);
  2301. DEFINE_2_MUXREG(pin_grp5, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_NFAD23_MASK, 0, 1);
  2302. DEFINE_2_MUXREG(pin_grp6, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_MCI_DATA8_15_MASK, 0, 1);
  2303. DEFINE_2_MUXREG(pin_grp7, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_NFCE2_MASK, 0, 1);
  2304. DEFINE_2_MUXREG(pin_grp8, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_NAND8_MASK, 0, 1);
  2305. DEFINE_2_MUXREG(nand_16bit_pins, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_NAND16BIT_1_MASK, 0, 1);
  2306. DEFINE_2_MUXREG(pin205, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_KBD_COL1_MASK | PMX_NFCE1_MASK, 0, 1);
  2307. DEFINE_2_MUXREG(pin206, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_KBD_COL0_MASK | PMX_NFCE2_MASK, 0, 1);
  2308. DEFINE_2_MUXREG(pin211, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_KBD_ROW1_MASK | PMX_NFWPRT1_MASK, 0, 1);
  2309. DEFINE_2_MUXREG(pin212, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_KBD_ROW0_MASK | PMX_NFWPRT2_MASK, 0, 1);
  2310. DEFINE_2_MUXREG(pin213, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_MCIDATA0_MASK, 0, 1);
  2311. DEFINE_2_MUXREG(pin214, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_MCIDATA1_MASK, 0, 1);
  2312. DEFINE_2_MUXREG(pin215, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_MCIDATA2_MASK, 0, 1);
  2313. DEFINE_2_MUXREG(pin216, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_MCIDATA3_MASK, 0, 1);
  2314. DEFINE_2_MUXREG(pin217, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_MCIDATA4_MASK, 0, 1);
  2315. DEFINE_2_MUXREG(pin218, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIDATA5_MASK, 0, 1);
  2316. DEFINE_2_MUXREG(pin219, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIDATA6_MASK, 0, 1);
  2317. DEFINE_2_MUXREG(pin220, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIDATA7_MASK, 0, 1);
  2318. DEFINE_2_MUXREG(pin221, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIDATA1SD_MASK, 0, 1);
  2319. DEFINE_2_MUXREG(pin222, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIDATA2SD_MASK, 0, 1);
  2320. DEFINE_2_MUXREG(pin223, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIDATA3SD_MASK, 0, 1);
  2321. DEFINE_2_MUXREG(pin224, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIADDR0ALE_MASK, 0, 1);
  2322. DEFINE_2_MUXREG(pin225, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIADDR1CLECLK_MASK, 0, 1);
  2323. DEFINE_2_MUXREG(pin226, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIADDR2_MASK, 0, 1);
  2324. DEFINE_2_MUXREG(pin227, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCICECF_MASK, 0, 1);
  2325. DEFINE_2_MUXREG(pin228, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCICEXD_MASK, 0, 1);
  2326. DEFINE_2_MUXREG(pin229, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCICESDMMC_MASK, 0, 1);
  2327. DEFINE_2_MUXREG(pin230, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCICDCF1_MASK, 0, 1);
  2328. DEFINE_2_MUXREG(pin231, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCICDCF2_MASK, 0, 1);
  2329. DEFINE_2_MUXREG(pin232, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCICDXD_MASK, 0, 1);
  2330. DEFINE_2_MUXREG(pin233, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCICDSDMMC_MASK, 0, 1);
  2331. DEFINE_2_MUXREG(pin234, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIDATADIR_MASK, 0, 1);
  2332. DEFINE_2_MUXREG(pin235, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIDMARQWP_MASK, 0, 1);
  2333. DEFINE_2_MUXREG(pin236, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIIORDRE_MASK, 0, 1);
  2334. DEFINE_2_MUXREG(pin237, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIIOWRWE_MASK, 0, 1);
  2335. DEFINE_2_MUXREG(pin238, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIRESETCF_MASK, 0, 1);
  2336. DEFINE_2_MUXREG(pin239, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCICS0CE_MASK, 0, 1);
  2337. DEFINE_2_MUXREG(pin240, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCICFINTR_MASK, 0, 1);
  2338. DEFINE_2_MUXREG(pin241, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIIORDY_MASK, 0, 1);
  2339. DEFINE_2_MUXREG(pin242, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCICS1_MASK, 0, 1);
  2340. DEFINE_2_MUXREG(pin243, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCIDMAACK_MASK, 0, 1);
  2341. DEFINE_2_MUXREG(pin244, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCISDCMD_MASK, 0, 1);
  2342. DEFINE_2_MUXREG(pin245, PAD_FUNCTION_EN_2, PAD_DIRECTION_SEL_2, PMX_MCILEDS_MASK, 0, 1);
  2343. DEFINE_2_MUXREG(keyboard_rowcol6_8_pins, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_KBD_ROWCOL68_MASK, 0, 1);
  2344. DEFINE_2_MUXREG(uart0_pins, PAD_FUNCTION_EN_0, PAD_DIRECTION_SEL_0, PMX_UART0_MASK, 0, 1);
  2345. DEFINE_2_MUXREG(uart0_modem_pins, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_UART0_MODEM_MASK, 0, 1);
  2346. DEFINE_2_MUXREG(gpt0_tmr0_pins, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_GPT0_TMR0_MASK, 0, 1);
  2347. DEFINE_2_MUXREG(gpt0_tmr1_pins, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_GPT0_TMR1_MASK, 0, 1);
  2348. DEFINE_2_MUXREG(gpt1_tmr0_pins, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_GPT1_TMR0_MASK, 0, 1);
  2349. DEFINE_2_MUXREG(gpt1_tmr1_pins, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_GPT1_TMR1_MASK, 0, 1);
  2350. DEFINE_2_MUXREG(touch_xy_pins, PAD_FUNCTION_EN_1, PAD_DIRECTION_SEL_1, PMX_TOUCH_XY_MASK, 0, 1);
  2351. static struct spear_gpio_pingroup spear1310_gpio_pingroup[] = {
  2352. GPIO_PINGROUP(i2c0_pins),
  2353. GPIO_PINGROUP(ssp0_pins),
  2354. GPIO_PINGROUP(ssp0_cs0_pins),
  2355. GPIO_PINGROUP(ssp0_cs1_2_pins),
  2356. GPIO_PINGROUP(i2s0_pins),
  2357. GPIO_PINGROUP(i2s1_pins),
  2358. GPIO_PINGROUP(clcd_pins),
  2359. GPIO_PINGROUP(clcd_high_res_pins),
  2360. GPIO_PINGROUP(pin18),
  2361. GPIO_PINGROUP(pin19),
  2362. GPIO_PINGROUP(pin20),
  2363. GPIO_PINGROUP(pin21),
  2364. GPIO_PINGROUP(pin22),
  2365. GPIO_PINGROUP(pin23),
  2366. GPIO_PINGROUP(pin143),
  2367. GPIO_PINGROUP(pin144),
  2368. GPIO_PINGROUP(pin145),
  2369. GPIO_PINGROUP(pin146),
  2370. GPIO_PINGROUP(pin147),
  2371. GPIO_PINGROUP(pin148),
  2372. GPIO_PINGROUP(pin149),
  2373. GPIO_PINGROUP(pin150),
  2374. GPIO_PINGROUP(pin151),
  2375. GPIO_PINGROUP(pin152),
  2376. GPIO_PINGROUP(smi_2_chips_pins),
  2377. GPIO_PINGROUP(pin54),
  2378. GPIO_PINGROUP(pin55),
  2379. GPIO_PINGROUP(pin56),
  2380. GPIO_PINGROUP(pin57),
  2381. GPIO_PINGROUP(pin58),
  2382. GPIO_PINGROUP(pin59),
  2383. GPIO_PINGROUP(pin60),
  2384. GPIO_PINGROUP(pin61),
  2385. GPIO_PINGROUP(pin62),
  2386. GPIO_PINGROUP(pin63),
  2387. GPIO_PINGROUP(pin_grp0),
  2388. GPIO_PINGROUP(pin_grp1),
  2389. GPIO_PINGROUP(pin_grp2),
  2390. GPIO_PINGROUP(pin_grp3),
  2391. GPIO_PINGROUP(pin_grp4),
  2392. GPIO_PINGROUP(pin_grp5),
  2393. GPIO_PINGROUP(pin_grp6),
  2394. GPIO_PINGROUP(pin_grp7),
  2395. GPIO_PINGROUP(pin_grp8),
  2396. GPIO_PINGROUP(nand_16bit_pins),
  2397. GPIO_PINGROUP(pin205),
  2398. GPIO_PINGROUP(pin206),
  2399. GPIO_PINGROUP(pin211),
  2400. GPIO_PINGROUP(pin212),
  2401. GPIO_PINGROUP(pin213),
  2402. GPIO_PINGROUP(pin214),
  2403. GPIO_PINGROUP(pin215),
  2404. GPIO_PINGROUP(pin216),
  2405. GPIO_PINGROUP(pin217),
  2406. GPIO_PINGROUP(pin218),
  2407. GPIO_PINGROUP(pin219),
  2408. GPIO_PINGROUP(pin220),
  2409. GPIO_PINGROUP(pin221),
  2410. GPIO_PINGROUP(pin222),
  2411. GPIO_PINGROUP(pin223),
  2412. GPIO_PINGROUP(pin224),
  2413. GPIO_PINGROUP(pin225),
  2414. GPIO_PINGROUP(pin226),
  2415. GPIO_PINGROUP(pin227),
  2416. GPIO_PINGROUP(pin228),
  2417. GPIO_PINGROUP(pin229),
  2418. GPIO_PINGROUP(pin230),
  2419. GPIO_PINGROUP(pin231),
  2420. GPIO_PINGROUP(pin232),
  2421. GPIO_PINGROUP(pin233),
  2422. GPIO_PINGROUP(pin234),
  2423. GPIO_PINGROUP(pin235),
  2424. GPIO_PINGROUP(pin236),
  2425. GPIO_PINGROUP(pin237),
  2426. GPIO_PINGROUP(pin238),
  2427. GPIO_PINGROUP(pin239),
  2428. GPIO_PINGROUP(pin240),
  2429. GPIO_PINGROUP(pin241),
  2430. GPIO_PINGROUP(pin242),
  2431. GPIO_PINGROUP(pin243),
  2432. GPIO_PINGROUP(pin244),
  2433. GPIO_PINGROUP(pin245),
  2434. GPIO_PINGROUP(keyboard_rowcol6_8_pins),
  2435. GPIO_PINGROUP(uart0_pins),
  2436. GPIO_PINGROUP(uart0_modem_pins),
  2437. GPIO_PINGROUP(gpt0_tmr0_pins),
  2438. GPIO_PINGROUP(gpt0_tmr1_pins),
  2439. GPIO_PINGROUP(gpt1_tmr0_pins),
  2440. GPIO_PINGROUP(gpt1_tmr1_pins),
  2441. GPIO_PINGROUP(touch_xy_pins),
  2442. };
  2443. static struct spear_pinctrl_machdata spear1310_machdata = {
  2444. .pins = spear1310_pins,
  2445. .npins = ARRAY_SIZE(spear1310_pins),
  2446. .groups = spear1310_pingroups,
  2447. .ngroups = ARRAY_SIZE(spear1310_pingroups),
  2448. .functions = spear1310_functions,
  2449. .nfunctions = ARRAY_SIZE(spear1310_functions),
  2450. .gpio_pingroups = spear1310_gpio_pingroup,
  2451. .ngpio_pingroups = ARRAY_SIZE(spear1310_gpio_pingroup),
  2452. .modes_supported = false,
  2453. };
  2454. static const struct of_device_id spear1310_pinctrl_of_match[] = {
  2455. {
  2456. .compatible = "st,spear1310-pinmux",
  2457. },
  2458. {},
  2459. };
  2460. static int spear1310_pinctrl_probe(struct platform_device *pdev)
  2461. {
  2462. return spear_pinctrl_probe(pdev, &spear1310_machdata);
  2463. }
  2464. static int spear1310_pinctrl_remove(struct platform_device *pdev)
  2465. {
  2466. return spear_pinctrl_remove(pdev);
  2467. }
  2468. static struct platform_driver spear1310_pinctrl_driver = {
  2469. .driver = {
  2470. .name = DRIVER_NAME,
  2471. .of_match_table = spear1310_pinctrl_of_match,
  2472. },
  2473. .probe = spear1310_pinctrl_probe,
  2474. .remove = spear1310_pinctrl_remove,
  2475. };
  2476. static int __init spear1310_pinctrl_init(void)
  2477. {
  2478. return platform_driver_register(&spear1310_pinctrl_driver);
  2479. }
  2480. arch_initcall(spear1310_pinctrl_init);
  2481. static void __exit spear1310_pinctrl_exit(void)
  2482. {
  2483. platform_driver_unregister(&spear1310_pinctrl_driver);
  2484. }
  2485. module_exit(spear1310_pinctrl_exit);
  2486. MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>");
  2487. MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver");
  2488. MODULE_LICENSE("GPL v2");
  2489. MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match);