pinctrl-spear1310.c 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198
  1. /*
  2. * Driver for the ST Microelectronics SPEAr1310 pinmux
  3. *
  4. * Copyright (C) 2012 ST Microelectronics
  5. * Viresh Kumar <viresh.kumar@st.com>
  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 0x32C
  25. #define MCIF_SEL_SHIFT 3
  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. /* combined macros */
  159. #define PMX_GMII_MASK (PMX_GMIICLK_MASK | \
  160. PMX_GMIICOL_CRS_XFERER_MIITXCLK_MASK | \
  161. PMX_RXCLK_RDV_TXEN_D03_MASK | \
  162. PMX_GMIID47_MASK | PMX_MDC_MDIO_MASK)
  163. #define PMX_EGPIO_0_GRP_MASK (PMX_EGPIO00_MASK | PMX_EGPIO01_MASK | \
  164. PMX_EGPIO02_MASK | \
  165. PMX_EGPIO03_MASK | PMX_EGPIO04_MASK | \
  166. PMX_EGPIO05_MASK | PMX_EGPIO06_MASK | \
  167. PMX_EGPIO07_MASK | PMX_EGPIO08_MASK | \
  168. PMX_EGPIO09_MASK)
  169. #define PMX_EGPIO_1_GRP_MASK (PMX_EGPIO10_MASK | PMX_EGPIO11_MASK | \
  170. PMX_EGPIO12_MASK | PMX_EGPIO13_MASK | \
  171. PMX_EGPIO14_MASK | PMX_EGPIO15_MASK)
  172. #define PMX_KEYBOARD_6X6_MASK (PMX_KBD_ROW0_MASK | PMX_KBD_ROW1_MASK | \
  173. PMX_KBD_ROWCOL25_MASK | PMX_KBD_COL0_MASK | \
  174. PMX_KBD_COL1_MASK)
  175. #define PMX_NAND8BIT_0_MASK (PMX_NAND8_MASK | PMX_NFAD23_MASK | \
  176. PMX_NFAD24_MASK | PMX_NFAD25_MASK | \
  177. PMX_NFWPRT3_MASK | PMX_NFRSTPWDWN0_MASK | \
  178. PMX_NFRSTPWDWN1_MASK | PMX_NFRSTPWDWN2_MASK | \
  179. PMX_NFCE3_MASK)
  180. #define PMX_NAND8BIT_1_MASK PMX_NFRSTPWDWN3_MASK
  181. #define PMX_NAND16BIT_1_MASK (PMX_KBD_ROWCOL25_MASK | PMX_NFIO8_15_MASK)
  182. #define PMX_NAND_4CHIPS_MASK (PMX_NFCE1_MASK | PMX_NFCE2_MASK | \
  183. PMX_NFWPRT1_MASK | PMX_NFWPRT2_MASK | \
  184. PMX_KBD_ROW0_MASK | PMX_KBD_ROW1_MASK | \
  185. PMX_KBD_COL0_MASK | PMX_KBD_COL1_MASK)
  186. #define PMX_MCIFALL_1_MASK 0xF8000000
  187. #define PMX_MCIFALL_2_MASK 0x0FFFFFFF
  188. #define PMX_PCI_REG1_MASK (PMX_SMINCS2_MASK | PMX_SMINCS3_MASK | \
  189. PMX_CLCD2_MASK | PMX_KBD_ROWCOL68_MASK | \
  190. PMX_EGPIO_1_GRP_MASK | PMX_GPT0_TMR0_MASK | \
  191. PMX_GPT0_TMR1_MASK | PMX_GPT1_TMR0_MASK | \
  192. PMX_GPT1_TMR1_MASK | PMX_I2S1_MASK | \
  193. PMX_NFCE2_MASK)
  194. #define PMX_PCI_REG2_MASK (PMX_TOUCH_XY_MASK | PMX_SSP0_CS0_MASK | \
  195. PMX_SSP0_CS1_2_MASK)
  196. #define PMX_SMII_0_1_2_MASK (PMX_CLCD2_MASK | PMX_KBD_ROWCOL68_MASK)
  197. #define PMX_RGMII_REG0_MASK (PMX_MCI_DATA8_15_MASK | \
  198. PMX_GMIICOL_CRS_XFERER_MIITXCLK_MASK | \
  199. PMX_GMIID47_MASK)
  200. #define PMX_RGMII_REG1_MASK (PMX_KBD_ROWCOL68_MASK | PMX_EGPIO_1_GRP_MASK |\
  201. PMX_KBD_ROW1_MASK | PMX_NFWPRT1_MASK | \
  202. PMX_KBD_ROW0_MASK | PMX_NFWPRT2_MASK)
  203. #define PMX_RGMII_REG2_MASK (PMX_TOUCH_XY_MASK | PMX_SSP0_CS0_MASK | \
  204. PMX_SSP0_CS1_2_MASK)
  205. #define PCIE_CFG_VAL(x) (PCIE_SATA##x##_SEL_PCIE | \
  206. PCIE##x##_CFG_AUX_CLK_EN | \
  207. PCIE##x##_CFG_CORE_CLK_EN | \
  208. PCIE##x##_CFG_POWERUP_RESET | \
  209. PCIE##x##_CFG_DEVICE_PRESENT)
  210. #define SATA_CFG_VAL(x) (PCIE_SATA##x##_SEL_SATA | \
  211. SATA##x##_CFG_PM_CLK_EN | \
  212. SATA##x##_CFG_POWERUP_RESET | \
  213. SATA##x##_CFG_RX_CLK_EN | \
  214. SATA##x##_CFG_TX_CLK_EN)
  215. /* Pad multiplexing for i2c0 device */
  216. static const unsigned i2c0_pins[] = { 102, 103 };
  217. static struct spear_muxreg i2c0_muxreg[] = {
  218. {
  219. .reg = PAD_FUNCTION_EN_0,
  220. .mask = PMX_I2C0_MASK,
  221. .val = PMX_I2C0_MASK,
  222. },
  223. };
  224. static struct spear_modemux i2c0_modemux[] = {
  225. {
  226. .muxregs = i2c0_muxreg,
  227. .nmuxregs = ARRAY_SIZE(i2c0_muxreg),
  228. },
  229. };
  230. static struct spear_pingroup i2c0_pingroup = {
  231. .name = "i2c0_grp",
  232. .pins = i2c0_pins,
  233. .npins = ARRAY_SIZE(i2c0_pins),
  234. .modemuxs = i2c0_modemux,
  235. .nmodemuxs = ARRAY_SIZE(i2c0_modemux),
  236. };
  237. static const char *const i2c0_grps[] = { "i2c0_grp" };
  238. static struct spear_function i2c0_function = {
  239. .name = "i2c0",
  240. .groups = i2c0_grps,
  241. .ngroups = ARRAY_SIZE(i2c0_grps),
  242. };
  243. /* Pad multiplexing for ssp0 device */
  244. static const unsigned ssp0_pins[] = { 109, 110, 111, 112 };
  245. static struct spear_muxreg ssp0_muxreg[] = {
  246. {
  247. .reg = PAD_FUNCTION_EN_0,
  248. .mask = PMX_SSP0_MASK,
  249. .val = PMX_SSP0_MASK,
  250. },
  251. };
  252. static struct spear_modemux ssp0_modemux[] = {
  253. {
  254. .muxregs = ssp0_muxreg,
  255. .nmuxregs = ARRAY_SIZE(ssp0_muxreg),
  256. },
  257. };
  258. static struct spear_pingroup ssp0_pingroup = {
  259. .name = "ssp0_grp",
  260. .pins = ssp0_pins,
  261. .npins = ARRAY_SIZE(ssp0_pins),
  262. .modemuxs = ssp0_modemux,
  263. .nmodemuxs = ARRAY_SIZE(ssp0_modemux),
  264. };
  265. /* Pad multiplexing for ssp0_cs0 device */
  266. static const unsigned ssp0_cs0_pins[] = { 96 };
  267. static struct spear_muxreg ssp0_cs0_muxreg[] = {
  268. {
  269. .reg = PAD_FUNCTION_EN_2,
  270. .mask = PMX_SSP0_CS0_MASK,
  271. .val = PMX_SSP0_CS0_MASK,
  272. },
  273. };
  274. static struct spear_modemux ssp0_cs0_modemux[] = {
  275. {
  276. .muxregs = ssp0_cs0_muxreg,
  277. .nmuxregs = ARRAY_SIZE(ssp0_cs0_muxreg),
  278. },
  279. };
  280. static struct spear_pingroup ssp0_cs0_pingroup = {
  281. .name = "ssp0_cs0_grp",
  282. .pins = ssp0_cs0_pins,
  283. .npins = ARRAY_SIZE(ssp0_cs0_pins),
  284. .modemuxs = ssp0_cs0_modemux,
  285. .nmodemuxs = ARRAY_SIZE(ssp0_cs0_modemux),
  286. };
  287. /* ssp0_cs1_2 device */
  288. static const unsigned ssp0_cs1_2_pins[] = { 94, 95 };
  289. static struct spear_muxreg ssp0_cs1_2_muxreg[] = {
  290. {
  291. .reg = PAD_FUNCTION_EN_2,
  292. .mask = PMX_SSP0_CS1_2_MASK,
  293. .val = PMX_SSP0_CS1_2_MASK,
  294. },
  295. };
  296. static struct spear_modemux ssp0_cs1_2_modemux[] = {
  297. {
  298. .muxregs = ssp0_cs1_2_muxreg,
  299. .nmuxregs = ARRAY_SIZE(ssp0_cs1_2_muxreg),
  300. },
  301. };
  302. static struct spear_pingroup ssp0_cs1_2_pingroup = {
  303. .name = "ssp0_cs1_2_grp",
  304. .pins = ssp0_cs1_2_pins,
  305. .npins = ARRAY_SIZE(ssp0_cs1_2_pins),
  306. .modemuxs = ssp0_cs1_2_modemux,
  307. .nmodemuxs = ARRAY_SIZE(ssp0_cs1_2_modemux),
  308. };
  309. static const char *const ssp0_grps[] = { "ssp0_grp", "ssp0_cs0_grp",
  310. "ssp0_cs1_2_grp" };
  311. static struct spear_function ssp0_function = {
  312. .name = "ssp0",
  313. .groups = ssp0_grps,
  314. .ngroups = ARRAY_SIZE(ssp0_grps),
  315. };
  316. /* Pad multiplexing for i2s0 device */
  317. static const unsigned i2s0_pins[] = { 104, 105, 106, 107, 108 };
  318. static struct spear_muxreg i2s0_muxreg[] = {
  319. {
  320. .reg = PAD_FUNCTION_EN_0,
  321. .mask = PMX_I2S0_MASK,
  322. .val = PMX_I2S0_MASK,
  323. },
  324. };
  325. static struct spear_modemux i2s0_modemux[] = {
  326. {
  327. .muxregs = i2s0_muxreg,
  328. .nmuxregs = ARRAY_SIZE(i2s0_muxreg),
  329. },
  330. };
  331. static struct spear_pingroup i2s0_pingroup = {
  332. .name = "i2s0_grp",
  333. .pins = i2s0_pins,
  334. .npins = ARRAY_SIZE(i2s0_pins),
  335. .modemuxs = i2s0_modemux,
  336. .nmodemuxs = ARRAY_SIZE(i2s0_modemux),
  337. };
  338. static const char *const i2s0_grps[] = { "i2s0_grp" };
  339. static struct spear_function i2s0_function = {
  340. .name = "i2s0",
  341. .groups = i2s0_grps,
  342. .ngroups = ARRAY_SIZE(i2s0_grps),
  343. };
  344. /* Pad multiplexing for i2s1 device */
  345. static const unsigned i2s1_pins[] = { 0, 1, 2, 3 };
  346. static struct spear_muxreg i2s1_muxreg[] = {
  347. {
  348. .reg = PAD_FUNCTION_EN_1,
  349. .mask = PMX_I2S1_MASK,
  350. .val = PMX_I2S1_MASK,
  351. },
  352. };
  353. static struct spear_modemux i2s1_modemux[] = {
  354. {
  355. .muxregs = i2s1_muxreg,
  356. .nmuxregs = ARRAY_SIZE(i2s1_muxreg),
  357. },
  358. };
  359. static struct spear_pingroup i2s1_pingroup = {
  360. .name = "i2s1_grp",
  361. .pins = i2s1_pins,
  362. .npins = ARRAY_SIZE(i2s1_pins),
  363. .modemuxs = i2s1_modemux,
  364. .nmodemuxs = ARRAY_SIZE(i2s1_modemux),
  365. };
  366. static const char *const i2s1_grps[] = { "i2s1_grp" };
  367. static struct spear_function i2s1_function = {
  368. .name = "i2s1",
  369. .groups = i2s1_grps,
  370. .ngroups = ARRAY_SIZE(i2s1_grps),
  371. };
  372. /* Pad multiplexing for clcd device */
  373. static const unsigned clcd_pins[] = { 113, 114, 115, 116, 117, 118, 119, 120,
  374. 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
  375. 135, 136, 137, 138, 139, 140, 141, 142 };
  376. static struct spear_muxreg clcd_muxreg[] = {
  377. {
  378. .reg = PAD_FUNCTION_EN_0,
  379. .mask = PMX_CLCD1_MASK,
  380. .val = PMX_CLCD1_MASK,
  381. },
  382. };
  383. static struct spear_modemux clcd_modemux[] = {
  384. {
  385. .muxregs = clcd_muxreg,
  386. .nmuxregs = ARRAY_SIZE(clcd_muxreg),
  387. },
  388. };
  389. static struct spear_pingroup clcd_pingroup = {
  390. .name = "clcd_grp",
  391. .pins = clcd_pins,
  392. .npins = ARRAY_SIZE(clcd_pins),
  393. .modemuxs = clcd_modemux,
  394. .nmodemuxs = ARRAY_SIZE(clcd_modemux),
  395. };
  396. static const unsigned clcd_high_res_pins[] = { 30, 31, 32, 33, 34, 35, 36, 37,
  397. 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 };
  398. static struct spear_muxreg clcd_high_res_muxreg[] = {
  399. {
  400. .reg = PAD_FUNCTION_EN_1,
  401. .mask = PMX_CLCD2_MASK,
  402. .val = PMX_CLCD2_MASK,
  403. },
  404. };
  405. static struct spear_modemux clcd_high_res_modemux[] = {
  406. {
  407. .muxregs = clcd_high_res_muxreg,
  408. .nmuxregs = ARRAY_SIZE(clcd_high_res_muxreg),
  409. },
  410. };
  411. static struct spear_pingroup clcd_high_res_pingroup = {
  412. .name = "clcd_high_res_grp",
  413. .pins = clcd_high_res_pins,
  414. .npins = ARRAY_SIZE(clcd_high_res_pins),
  415. .modemuxs = clcd_high_res_modemux,
  416. .nmodemuxs = ARRAY_SIZE(clcd_high_res_modemux),
  417. };
  418. static const char *const clcd_grps[] = { "clcd_grp", "clcd_high_res" };
  419. static struct spear_function clcd_function = {
  420. .name = "clcd",
  421. .groups = clcd_grps,
  422. .ngroups = ARRAY_SIZE(clcd_grps),
  423. };
  424. static const unsigned arm_gpio_pins[] = { 18, 19, 20, 21, 22, 23, 143, 144, 145,
  425. 146, 147, 148, 149, 150, 151, 152 };
  426. static struct spear_muxreg arm_gpio_muxreg[] = {
  427. {
  428. .reg = PAD_FUNCTION_EN_0,
  429. .mask = PMX_EGPIO_0_GRP_MASK,
  430. .val = PMX_EGPIO_0_GRP_MASK,
  431. }, {
  432. .reg = PAD_FUNCTION_EN_1,
  433. .mask = PMX_EGPIO_1_GRP_MASK,
  434. .val = PMX_EGPIO_1_GRP_MASK,
  435. },
  436. };
  437. static struct spear_modemux arm_gpio_modemux[] = {
  438. {
  439. .muxregs = arm_gpio_muxreg,
  440. .nmuxregs = ARRAY_SIZE(arm_gpio_muxreg),
  441. },
  442. };
  443. static struct spear_pingroup arm_gpio_pingroup = {
  444. .name = "arm_gpio_grp",
  445. .pins = arm_gpio_pins,
  446. .npins = ARRAY_SIZE(arm_gpio_pins),
  447. .modemuxs = arm_gpio_modemux,
  448. .nmodemuxs = ARRAY_SIZE(arm_gpio_modemux),
  449. };
  450. static const char *const arm_gpio_grps[] = { "arm_gpio_grp" };
  451. static struct spear_function arm_gpio_function = {
  452. .name = "arm_gpio",
  453. .groups = arm_gpio_grps,
  454. .ngroups = ARRAY_SIZE(arm_gpio_grps),
  455. };
  456. /* Pad multiplexing for smi 2 chips device */
  457. static const unsigned smi_2_chips_pins[] = { 153, 154, 155, 156, 157 };
  458. static struct spear_muxreg smi_2_chips_muxreg[] = {
  459. {
  460. .reg = PAD_FUNCTION_EN_0,
  461. .mask = PMX_SMI_MASK,
  462. .val = PMX_SMI_MASK,
  463. },
  464. };
  465. static struct spear_modemux smi_2_chips_modemux[] = {
  466. {
  467. .muxregs = smi_2_chips_muxreg,
  468. .nmuxregs = ARRAY_SIZE(smi_2_chips_muxreg),
  469. },
  470. };
  471. static struct spear_pingroup smi_2_chips_pingroup = {
  472. .name = "smi_2_chips_grp",
  473. .pins = smi_2_chips_pins,
  474. .npins = ARRAY_SIZE(smi_2_chips_pins),
  475. .modemuxs = smi_2_chips_modemux,
  476. .nmodemuxs = ARRAY_SIZE(smi_2_chips_modemux),
  477. };
  478. static const unsigned smi_4_chips_pins[] = { 54, 55 };
  479. static struct spear_muxreg smi_4_chips_muxreg[] = {
  480. {
  481. .reg = PAD_FUNCTION_EN_0,
  482. .mask = PMX_SMI_MASK,
  483. .val = PMX_SMI_MASK,
  484. }, {
  485. .reg = PAD_FUNCTION_EN_1,
  486. .mask = PMX_SMINCS2_MASK | PMX_SMINCS3_MASK,
  487. .val = PMX_SMINCS2_MASK | PMX_SMINCS3_MASK,
  488. },
  489. };
  490. static struct spear_modemux smi_4_chips_modemux[] = {
  491. {
  492. .muxregs = smi_4_chips_muxreg,
  493. .nmuxregs = ARRAY_SIZE(smi_4_chips_muxreg),
  494. },
  495. };
  496. static struct spear_pingroup smi_4_chips_pingroup = {
  497. .name = "smi_4_chips_grp",
  498. .pins = smi_4_chips_pins,
  499. .npins = ARRAY_SIZE(smi_4_chips_pins),
  500. .modemuxs = smi_4_chips_modemux,
  501. .nmodemuxs = ARRAY_SIZE(smi_4_chips_modemux),
  502. };
  503. static const char *const smi_grps[] = { "smi_2_chips_grp", "smi_4_chips_grp" };
  504. static struct spear_function smi_function = {
  505. .name = "smi",
  506. .groups = smi_grps,
  507. .ngroups = ARRAY_SIZE(smi_grps),
  508. };
  509. /* Pad multiplexing for gmii device */
  510. static const unsigned gmii_pins[] = { 173, 174, 175, 176, 177, 178, 179, 180,
  511. 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
  512. 195, 196, 197, 198, 199, 200 };
  513. static struct spear_muxreg gmii_muxreg[] = {
  514. {
  515. .reg = PAD_FUNCTION_EN_0,
  516. .mask = PMX_GMII_MASK,
  517. .val = PMX_GMII_MASK,
  518. },
  519. };
  520. static struct spear_modemux gmii_modemux[] = {
  521. {
  522. .muxregs = gmii_muxreg,
  523. .nmuxregs = ARRAY_SIZE(gmii_muxreg),
  524. },
  525. };
  526. static struct spear_pingroup gmii_pingroup = {
  527. .name = "gmii_grp",
  528. .pins = gmii_pins,
  529. .npins = ARRAY_SIZE(gmii_pins),
  530. .modemuxs = gmii_modemux,
  531. .nmodemuxs = ARRAY_SIZE(gmii_modemux),
  532. };
  533. static const char *const gmii_grps[] = { "gmii_grp" };
  534. static struct spear_function gmii_function = {
  535. .name = "gmii",
  536. .groups = gmii_grps,
  537. .ngroups = ARRAY_SIZE(gmii_grps),
  538. };
  539. /* Pad multiplexing for rgmii device */
  540. static const unsigned rgmii_pins[] = { 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
  541. 28, 29, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 175,
  542. 180, 181, 182, 183, 185, 188, 193, 194, 195, 196, 197, 198, 211, 212 };
  543. static struct spear_muxreg rgmii_muxreg[] = {
  544. {
  545. .reg = PAD_FUNCTION_EN_0,
  546. .mask = PMX_RGMII_REG0_MASK,
  547. .val = 0,
  548. }, {
  549. .reg = PAD_FUNCTION_EN_1,
  550. .mask = PMX_RGMII_REG1_MASK,
  551. .val = 0,
  552. }, {
  553. .reg = PAD_FUNCTION_EN_2,
  554. .mask = PMX_RGMII_REG2_MASK,
  555. .val = 0,
  556. },
  557. };
  558. static struct spear_modemux rgmii_modemux[] = {
  559. {
  560. .muxregs = rgmii_muxreg,
  561. .nmuxregs = ARRAY_SIZE(rgmii_muxreg),
  562. },
  563. };
  564. static struct spear_pingroup rgmii_pingroup = {
  565. .name = "rgmii_grp",
  566. .pins = rgmii_pins,
  567. .npins = ARRAY_SIZE(rgmii_pins),
  568. .modemuxs = rgmii_modemux,
  569. .nmodemuxs = ARRAY_SIZE(rgmii_modemux),
  570. };
  571. static const char *const rgmii_grps[] = { "rgmii_grp" };
  572. static struct spear_function rgmii_function = {
  573. .name = "rgmii",
  574. .groups = rgmii_grps,
  575. .ngroups = ARRAY_SIZE(rgmii_grps),
  576. };
  577. /* Pad multiplexing for smii_0_1_2 device */
  578. static const unsigned smii_0_1_2_pins[] = { 24, 25, 26, 27, 28, 29, 30, 31, 32,
  579. 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
  580. 51, 52, 53, 54, 55 };
  581. static struct spear_muxreg smii_0_1_2_muxreg[] = {
  582. {
  583. .reg = PAD_FUNCTION_EN_1,
  584. .mask = PMX_SMII_0_1_2_MASK,
  585. .val = 0,
  586. },
  587. };
  588. static struct spear_modemux smii_0_1_2_modemux[] = {
  589. {
  590. .muxregs = smii_0_1_2_muxreg,
  591. .nmuxregs = ARRAY_SIZE(smii_0_1_2_muxreg),
  592. },
  593. };
  594. static struct spear_pingroup smii_0_1_2_pingroup = {
  595. .name = "smii_0_1_2_grp",
  596. .pins = smii_0_1_2_pins,
  597. .npins = ARRAY_SIZE(smii_0_1_2_pins),
  598. .modemuxs = smii_0_1_2_modemux,
  599. .nmodemuxs = ARRAY_SIZE(smii_0_1_2_modemux),
  600. };
  601. static const char *const smii_0_1_2_grps[] = { "smii_0_1_2_grp" };
  602. static struct spear_function smii_0_1_2_function = {
  603. .name = "smii_0_1_2",
  604. .groups = smii_0_1_2_grps,
  605. .ngroups = ARRAY_SIZE(smii_0_1_2_grps),
  606. };
  607. /* Pad multiplexing for ras_mii_txclk device */
  608. static const unsigned ras_mii_txclk_pins[] = { 98, 99 };
  609. static struct spear_muxreg ras_mii_txclk_muxreg[] = {
  610. {
  611. .reg = PAD_FUNCTION_EN_1,
  612. .mask = PMX_NFCE2_MASK,
  613. .val = 0,
  614. },
  615. };
  616. static struct spear_modemux ras_mii_txclk_modemux[] = {
  617. {
  618. .muxregs = ras_mii_txclk_muxreg,
  619. .nmuxregs = ARRAY_SIZE(ras_mii_txclk_muxreg),
  620. },
  621. };
  622. static struct spear_pingroup ras_mii_txclk_pingroup = {
  623. .name = "ras_mii_txclk_grp",
  624. .pins = ras_mii_txclk_pins,
  625. .npins = ARRAY_SIZE(ras_mii_txclk_pins),
  626. .modemuxs = ras_mii_txclk_modemux,
  627. .nmodemuxs = ARRAY_SIZE(ras_mii_txclk_modemux),
  628. };
  629. static const char *const ras_mii_txclk_grps[] = { "ras_mii_txclk_grp" };
  630. static struct spear_function ras_mii_txclk_function = {
  631. .name = "ras_mii_txclk",
  632. .groups = ras_mii_txclk_grps,
  633. .ngroups = ARRAY_SIZE(ras_mii_txclk_grps),
  634. };
  635. /* Pad multiplexing for nand 8bit device (cs0 only) */
  636. static const unsigned nand_8bit_pins[] = { 56, 57, 58, 59, 60, 61, 62, 63, 64,
  637. 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
  638. 83, 84, 85, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
  639. 170, 171, 172, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
  640. 212 };
  641. static struct spear_muxreg nand_8bit_muxreg[] = {
  642. {
  643. .reg = PAD_FUNCTION_EN_0,
  644. .mask = PMX_NAND8BIT_0_MASK,
  645. .val = PMX_NAND8BIT_0_MASK,
  646. }, {
  647. .reg = PAD_FUNCTION_EN_1,
  648. .mask = PMX_NAND8BIT_1_MASK,
  649. .val = PMX_NAND8BIT_1_MASK,
  650. },
  651. };
  652. static struct spear_modemux nand_8bit_modemux[] = {
  653. {
  654. .muxregs = nand_8bit_muxreg,
  655. .nmuxregs = ARRAY_SIZE(nand_8bit_muxreg),
  656. },
  657. };
  658. static struct spear_pingroup nand_8bit_pingroup = {
  659. .name = "nand_8bit_grp",
  660. .pins = nand_8bit_pins,
  661. .npins = ARRAY_SIZE(nand_8bit_pins),
  662. .modemuxs = nand_8bit_modemux,
  663. .nmodemuxs = ARRAY_SIZE(nand_8bit_modemux),
  664. };
  665. /* Pad multiplexing for nand 16bit device */
  666. static const unsigned nand_16bit_pins[] = { 201, 202, 203, 204, 207, 208, 209,
  667. 210 };
  668. static struct spear_muxreg nand_16bit_muxreg[] = {
  669. {
  670. .reg = PAD_FUNCTION_EN_1,
  671. .mask = PMX_NAND16BIT_1_MASK,
  672. .val = PMX_NAND16BIT_1_MASK,
  673. },
  674. };
  675. static struct spear_modemux nand_16bit_modemux[] = {
  676. {
  677. .muxregs = nand_16bit_muxreg,
  678. .nmuxregs = ARRAY_SIZE(nand_16bit_muxreg),
  679. },
  680. };
  681. static struct spear_pingroup nand_16bit_pingroup = {
  682. .name = "nand_16bit_grp",
  683. .pins = nand_16bit_pins,
  684. .npins = ARRAY_SIZE(nand_16bit_pins),
  685. .modemuxs = nand_16bit_modemux,
  686. .nmodemuxs = ARRAY_SIZE(nand_16bit_modemux),
  687. };
  688. /* Pad multiplexing for nand 4 chips */
  689. static const unsigned nand_4_chips_pins[] = { 205, 206, 211, 212 };
  690. static struct spear_muxreg nand_4_chips_muxreg[] = {
  691. {
  692. .reg = PAD_FUNCTION_EN_1,
  693. .mask = PMX_NAND_4CHIPS_MASK,
  694. .val = PMX_NAND_4CHIPS_MASK,
  695. },
  696. };
  697. static struct spear_modemux nand_4_chips_modemux[] = {
  698. {
  699. .muxregs = nand_4_chips_muxreg,
  700. .nmuxregs = ARRAY_SIZE(nand_4_chips_muxreg),
  701. },
  702. };
  703. static struct spear_pingroup nand_4_chips_pingroup = {
  704. .name = "nand_4_chips_grp",
  705. .pins = nand_4_chips_pins,
  706. .npins = ARRAY_SIZE(nand_4_chips_pins),
  707. .modemuxs = nand_4_chips_modemux,
  708. .nmodemuxs = ARRAY_SIZE(nand_4_chips_modemux),
  709. };
  710. static const char *const nand_grps[] = { "nand_8bit_grp", "nand_16bit_grp",
  711. "nand_4_chips_grp" };
  712. static struct spear_function nand_function = {
  713. .name = "nand",
  714. .groups = nand_grps,
  715. .ngroups = ARRAY_SIZE(nand_grps),
  716. };
  717. /* Pad multiplexing for keyboard_6x6 device */
  718. static const unsigned keyboard_6x6_pins[] = { 201, 202, 203, 204, 205, 206, 207,
  719. 208, 209, 210, 211, 212 };
  720. static struct spear_muxreg keyboard_6x6_muxreg[] = {
  721. {
  722. .reg = PAD_FUNCTION_EN_1,
  723. .mask = PMX_KEYBOARD_6X6_MASK | PMX_NFIO8_15_MASK |
  724. PMX_NFCE1_MASK | PMX_NFCE2_MASK | PMX_NFWPRT1_MASK |
  725. PMX_NFWPRT2_MASK,
  726. .val = PMX_KEYBOARD_6X6_MASK,
  727. },
  728. };
  729. static struct spear_modemux keyboard_6x6_modemux[] = {
  730. {
  731. .muxregs = keyboard_6x6_muxreg,
  732. .nmuxregs = ARRAY_SIZE(keyboard_6x6_muxreg),
  733. },
  734. };
  735. static struct spear_pingroup keyboard_6x6_pingroup = {
  736. .name = "keyboard_6x6_grp",
  737. .pins = keyboard_6x6_pins,
  738. .npins = ARRAY_SIZE(keyboard_6x6_pins),
  739. .modemuxs = keyboard_6x6_modemux,
  740. .nmodemuxs = ARRAY_SIZE(keyboard_6x6_modemux),
  741. };
  742. /* Pad multiplexing for keyboard_rowcol6_8 device */
  743. static const unsigned keyboard_rowcol6_8_pins[] = { 24, 25, 26, 27, 28, 29 };
  744. static struct spear_muxreg keyboard_rowcol6_8_muxreg[] = {
  745. {
  746. .reg = PAD_FUNCTION_EN_1,
  747. .mask = PMX_KBD_ROWCOL68_MASK,
  748. .val = PMX_KBD_ROWCOL68_MASK,
  749. },
  750. };
  751. static struct spear_modemux keyboard_rowcol6_8_modemux[] = {
  752. {
  753. .muxregs = keyboard_rowcol6_8_muxreg,
  754. .nmuxregs = ARRAY_SIZE(keyboard_rowcol6_8_muxreg),
  755. },
  756. };
  757. static struct spear_pingroup keyboard_rowcol6_8_pingroup = {
  758. .name = "keyboard_rowcol6_8_grp",
  759. .pins = keyboard_rowcol6_8_pins,
  760. .npins = ARRAY_SIZE(keyboard_rowcol6_8_pins),
  761. .modemuxs = keyboard_rowcol6_8_modemux,
  762. .nmodemuxs = ARRAY_SIZE(keyboard_rowcol6_8_modemux),
  763. };
  764. static const char *const keyboard_grps[] = { "keyboard_6x6_grp",
  765. "keyboard_rowcol6_8_grp" };
  766. static struct spear_function keyboard_function = {
  767. .name = "keyboard",
  768. .groups = keyboard_grps,
  769. .ngroups = ARRAY_SIZE(keyboard_grps),
  770. };
  771. /* Pad multiplexing for uart0 device */
  772. static const unsigned uart0_pins[] = { 100, 101 };
  773. static struct spear_muxreg uart0_muxreg[] = {
  774. {
  775. .reg = PAD_FUNCTION_EN_0,
  776. .mask = PMX_UART0_MASK,
  777. .val = PMX_UART0_MASK,
  778. },
  779. };
  780. static struct spear_modemux uart0_modemux[] = {
  781. {
  782. .muxregs = uart0_muxreg,
  783. .nmuxregs = ARRAY_SIZE(uart0_muxreg),
  784. },
  785. };
  786. static struct spear_pingroup uart0_pingroup = {
  787. .name = "uart0_grp",
  788. .pins = uart0_pins,
  789. .npins = ARRAY_SIZE(uart0_pins),
  790. .modemuxs = uart0_modemux,
  791. .nmodemuxs = ARRAY_SIZE(uart0_modemux),
  792. };
  793. /* Pad multiplexing for uart0_modem device */
  794. static const unsigned uart0_modem_pins[] = { 12, 13, 14, 15, 16, 17 };
  795. static struct spear_muxreg uart0_modem_muxreg[] = {
  796. {
  797. .reg = PAD_FUNCTION_EN_1,
  798. .mask = PMX_UART0_MODEM_MASK,
  799. .val = PMX_UART0_MODEM_MASK,
  800. },
  801. };
  802. static struct spear_modemux uart0_modem_modemux[] = {
  803. {
  804. .muxregs = uart0_modem_muxreg,
  805. .nmuxregs = ARRAY_SIZE(uart0_modem_muxreg),
  806. },
  807. };
  808. static struct spear_pingroup uart0_modem_pingroup = {
  809. .name = "uart0_modem_grp",
  810. .pins = uart0_modem_pins,
  811. .npins = ARRAY_SIZE(uart0_modem_pins),
  812. .modemuxs = uart0_modem_modemux,
  813. .nmodemuxs = ARRAY_SIZE(uart0_modem_modemux),
  814. };
  815. static const char *const uart0_grps[] = { "uart0_grp", "uart0_modem_grp" };
  816. static struct spear_function uart0_function = {
  817. .name = "uart0",
  818. .groups = uart0_grps,
  819. .ngroups = ARRAY_SIZE(uart0_grps),
  820. };
  821. /* Pad multiplexing for gpt0_tmr0 device */
  822. static const unsigned gpt0_tmr0_pins[] = { 10, 11 };
  823. static struct spear_muxreg gpt0_tmr0_muxreg[] = {
  824. {
  825. .reg = PAD_FUNCTION_EN_1,
  826. .mask = PMX_GPT0_TMR0_MASK,
  827. .val = PMX_GPT0_TMR0_MASK,
  828. },
  829. };
  830. static struct spear_modemux gpt0_tmr0_modemux[] = {
  831. {
  832. .muxregs = gpt0_tmr0_muxreg,
  833. .nmuxregs = ARRAY_SIZE(gpt0_tmr0_muxreg),
  834. },
  835. };
  836. static struct spear_pingroup gpt0_tmr0_pingroup = {
  837. .name = "gpt0_tmr0_grp",
  838. .pins = gpt0_tmr0_pins,
  839. .npins = ARRAY_SIZE(gpt0_tmr0_pins),
  840. .modemuxs = gpt0_tmr0_modemux,
  841. .nmodemuxs = ARRAY_SIZE(gpt0_tmr0_modemux),
  842. };
  843. /* Pad multiplexing for gpt0_tmr1 device */
  844. static const unsigned gpt0_tmr1_pins[] = { 8, 9 };
  845. static struct spear_muxreg gpt0_tmr1_muxreg[] = {
  846. {
  847. .reg = PAD_FUNCTION_EN_1,
  848. .mask = PMX_GPT0_TMR1_MASK,
  849. .val = PMX_GPT0_TMR1_MASK,
  850. },
  851. };
  852. static struct spear_modemux gpt0_tmr1_modemux[] = {
  853. {
  854. .muxregs = gpt0_tmr1_muxreg,
  855. .nmuxregs = ARRAY_SIZE(gpt0_tmr1_muxreg),
  856. },
  857. };
  858. static struct spear_pingroup gpt0_tmr1_pingroup = {
  859. .name = "gpt0_tmr1_grp",
  860. .pins = gpt0_tmr1_pins,
  861. .npins = ARRAY_SIZE(gpt0_tmr1_pins),
  862. .modemuxs = gpt0_tmr1_modemux,
  863. .nmodemuxs = ARRAY_SIZE(gpt0_tmr1_modemux),
  864. };
  865. static const char *const gpt0_grps[] = { "gpt0_tmr0_grp", "gpt0_tmr1_grp" };
  866. static struct spear_function gpt0_function = {
  867. .name = "gpt0",
  868. .groups = gpt0_grps,
  869. .ngroups = ARRAY_SIZE(gpt0_grps),
  870. };
  871. /* Pad multiplexing for gpt1_tmr0 device */
  872. static const unsigned gpt1_tmr0_pins[] = { 6, 7 };
  873. static struct spear_muxreg gpt1_tmr0_muxreg[] = {
  874. {
  875. .reg = PAD_FUNCTION_EN_1,
  876. .mask = PMX_GPT1_TMR0_MASK,
  877. .val = PMX_GPT1_TMR0_MASK,
  878. },
  879. };
  880. static struct spear_modemux gpt1_tmr0_modemux[] = {
  881. {
  882. .muxregs = gpt1_tmr0_muxreg,
  883. .nmuxregs = ARRAY_SIZE(gpt1_tmr0_muxreg),
  884. },
  885. };
  886. static struct spear_pingroup gpt1_tmr0_pingroup = {
  887. .name = "gpt1_tmr0_grp",
  888. .pins = gpt1_tmr0_pins,
  889. .npins = ARRAY_SIZE(gpt1_tmr0_pins),
  890. .modemuxs = gpt1_tmr0_modemux,
  891. .nmodemuxs = ARRAY_SIZE(gpt1_tmr0_modemux),
  892. };
  893. /* Pad multiplexing for gpt1_tmr1 device */
  894. static const unsigned gpt1_tmr1_pins[] = { 4, 5 };
  895. static struct spear_muxreg gpt1_tmr1_muxreg[] = {
  896. {
  897. .reg = PAD_FUNCTION_EN_1,
  898. .mask = PMX_GPT1_TMR1_MASK,
  899. .val = PMX_GPT1_TMR1_MASK,
  900. },
  901. };
  902. static struct spear_modemux gpt1_tmr1_modemux[] = {
  903. {
  904. .muxregs = gpt1_tmr1_muxreg,
  905. .nmuxregs = ARRAY_SIZE(gpt1_tmr1_muxreg),
  906. },
  907. };
  908. static struct spear_pingroup gpt1_tmr1_pingroup = {
  909. .name = "gpt1_tmr1_grp",
  910. .pins = gpt1_tmr1_pins,
  911. .npins = ARRAY_SIZE(gpt1_tmr1_pins),
  912. .modemuxs = gpt1_tmr1_modemux,
  913. .nmodemuxs = ARRAY_SIZE(gpt1_tmr1_modemux),
  914. };
  915. static const char *const gpt1_grps[] = { "gpt1_tmr1_grp", "gpt1_tmr0_grp" };
  916. static struct spear_function gpt1_function = {
  917. .name = "gpt1",
  918. .groups = gpt1_grps,
  919. .ngroups = ARRAY_SIZE(gpt1_grps),
  920. };
  921. /* Pad multiplexing for mcif device */
  922. static const unsigned mcif_pins[] = { 86, 87, 88, 89, 90, 91, 92, 93, 213, 214,
  923. 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
  924. 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242,
  925. 243, 244, 245 };
  926. #define MCIF_MUXREG \
  927. { \
  928. .reg = PAD_FUNCTION_EN_0, \
  929. .mask = PMX_MCI_DATA8_15_MASK, \
  930. .val = PMX_MCI_DATA8_15_MASK, \
  931. }, { \
  932. .reg = PAD_FUNCTION_EN_1, \
  933. .mask = PMX_MCIFALL_1_MASK | PMX_NFWPRT1_MASK | \
  934. PMX_NFWPRT2_MASK, \
  935. .val = PMX_MCIFALL_1_MASK, \
  936. }, { \
  937. .reg = PAD_FUNCTION_EN_2, \
  938. .mask = PMX_MCIFALL_2_MASK, \
  939. .val = PMX_MCIFALL_2_MASK, \
  940. }
  941. /* sdhci device */
  942. static struct spear_muxreg sdhci_muxreg[] = {
  943. MCIF_MUXREG,
  944. {
  945. .reg = PERIP_CFG,
  946. .mask = MCIF_SEL_MASK,
  947. .val = MCIF_SEL_SD,
  948. },
  949. };
  950. static struct spear_modemux sdhci_modemux[] = {
  951. {
  952. .muxregs = sdhci_muxreg,
  953. .nmuxregs = ARRAY_SIZE(sdhci_muxreg),
  954. },
  955. };
  956. static struct spear_pingroup sdhci_pingroup = {
  957. .name = "sdhci_grp",
  958. .pins = mcif_pins,
  959. .npins = ARRAY_SIZE(mcif_pins),
  960. .modemuxs = sdhci_modemux,
  961. .nmodemuxs = ARRAY_SIZE(sdhci_modemux),
  962. };
  963. static const char *const sdhci_grps[] = { "sdhci_grp" };
  964. static struct spear_function sdhci_function = {
  965. .name = "sdhci",
  966. .groups = sdhci_grps,
  967. .ngroups = ARRAY_SIZE(sdhci_grps),
  968. };
  969. /* cf device */
  970. static struct spear_muxreg cf_muxreg[] = {
  971. MCIF_MUXREG,
  972. {
  973. .reg = PERIP_CFG,
  974. .mask = MCIF_SEL_MASK,
  975. .val = MCIF_SEL_CF,
  976. },
  977. };
  978. static struct spear_modemux cf_modemux[] = {
  979. {
  980. .muxregs = cf_muxreg,
  981. .nmuxregs = ARRAY_SIZE(cf_muxreg),
  982. },
  983. };
  984. static struct spear_pingroup cf_pingroup = {
  985. .name = "cf_grp",
  986. .pins = mcif_pins,
  987. .npins = ARRAY_SIZE(mcif_pins),
  988. .modemuxs = cf_modemux,
  989. .nmodemuxs = ARRAY_SIZE(cf_modemux),
  990. };
  991. static const char *const cf_grps[] = { "cf_grp" };
  992. static struct spear_function cf_function = {
  993. .name = "cf",
  994. .groups = cf_grps,
  995. .ngroups = ARRAY_SIZE(cf_grps),
  996. };
  997. /* xd device */
  998. static struct spear_muxreg xd_muxreg[] = {
  999. MCIF_MUXREG,
  1000. {
  1001. .reg = PERIP_CFG,
  1002. .mask = MCIF_SEL_MASK,
  1003. .val = MCIF_SEL_XD,
  1004. },
  1005. };
  1006. static struct spear_modemux xd_modemux[] = {
  1007. {
  1008. .muxregs = xd_muxreg,
  1009. .nmuxregs = ARRAY_SIZE(xd_muxreg),
  1010. },
  1011. };
  1012. static struct spear_pingroup xd_pingroup = {
  1013. .name = "xd_grp",
  1014. .pins = mcif_pins,
  1015. .npins = ARRAY_SIZE(mcif_pins),
  1016. .modemuxs = xd_modemux,
  1017. .nmodemuxs = ARRAY_SIZE(xd_modemux),
  1018. };
  1019. static const char *const xd_grps[] = { "xd_grp" };
  1020. static struct spear_function xd_function = {
  1021. .name = "xd",
  1022. .groups = xd_grps,
  1023. .ngroups = ARRAY_SIZE(xd_grps),
  1024. };
  1025. /* Pad multiplexing for touch_xy device */
  1026. static const unsigned touch_xy_pins[] = { 97 };
  1027. static struct spear_muxreg touch_xy_muxreg[] = {
  1028. {
  1029. .reg = PAD_FUNCTION_EN_2,
  1030. .mask = PMX_TOUCH_XY_MASK,
  1031. .val = PMX_TOUCH_XY_MASK,
  1032. },
  1033. };
  1034. static struct spear_modemux touch_xy_modemux[] = {
  1035. {
  1036. .muxregs = touch_xy_muxreg,
  1037. .nmuxregs = ARRAY_SIZE(touch_xy_muxreg),
  1038. },
  1039. };
  1040. static struct spear_pingroup touch_xy_pingroup = {
  1041. .name = "touch_xy_grp",
  1042. .pins = touch_xy_pins,
  1043. .npins = ARRAY_SIZE(touch_xy_pins),
  1044. .modemuxs = touch_xy_modemux,
  1045. .nmodemuxs = ARRAY_SIZE(touch_xy_modemux),
  1046. };
  1047. static const char *const touch_xy_grps[] = { "touch_xy_grp" };
  1048. static struct spear_function touch_xy_function = {
  1049. .name = "touchscreen",
  1050. .groups = touch_xy_grps,
  1051. .ngroups = ARRAY_SIZE(touch_xy_grps),
  1052. };
  1053. /* Pad multiplexing for uart1 device */
  1054. /* Muxed with I2C */
  1055. static const unsigned uart1_dis_i2c_pins[] = { 102, 103 };
  1056. static struct spear_muxreg uart1_dis_i2c_muxreg[] = {
  1057. {
  1058. .reg = PAD_FUNCTION_EN_0,
  1059. .mask = PMX_I2C0_MASK,
  1060. .val = 0,
  1061. },
  1062. };
  1063. static struct spear_modemux uart1_dis_i2c_modemux[] = {
  1064. {
  1065. .muxregs = uart1_dis_i2c_muxreg,
  1066. .nmuxregs = ARRAY_SIZE(uart1_dis_i2c_muxreg),
  1067. },
  1068. };
  1069. static struct spear_pingroup uart_1_dis_i2c_pingroup = {
  1070. .name = "uart1_disable_i2c_grp",
  1071. .pins = uart1_dis_i2c_pins,
  1072. .npins = ARRAY_SIZE(uart1_dis_i2c_pins),
  1073. .modemuxs = uart1_dis_i2c_modemux,
  1074. .nmodemuxs = ARRAY_SIZE(uart1_dis_i2c_modemux),
  1075. };
  1076. /* Muxed with SD/MMC */
  1077. static const unsigned uart1_dis_sd_pins[] = { 214, 215 };
  1078. static struct spear_muxreg uart1_dis_sd_muxreg[] = {
  1079. {
  1080. .reg = PAD_FUNCTION_EN_1,
  1081. .mask = PMX_MCIDATA1_MASK |
  1082. PMX_MCIDATA2_MASK,
  1083. .val = 0,
  1084. },
  1085. };
  1086. static struct spear_modemux uart1_dis_sd_modemux[] = {
  1087. {
  1088. .muxregs = uart1_dis_sd_muxreg,
  1089. .nmuxregs = ARRAY_SIZE(uart1_dis_sd_muxreg),
  1090. },
  1091. };
  1092. static struct spear_pingroup uart_1_dis_sd_pingroup = {
  1093. .name = "uart1_disable_sd_grp",
  1094. .pins = uart1_dis_sd_pins,
  1095. .npins = ARRAY_SIZE(uart1_dis_sd_pins),
  1096. .modemuxs = uart1_dis_sd_modemux,
  1097. .nmodemuxs = ARRAY_SIZE(uart1_dis_sd_modemux),
  1098. };
  1099. static const char *const uart1_grps[] = { "uart1_disable_i2c_grp",
  1100. "uart1_disable_sd_grp" };
  1101. static struct spear_function uart1_function = {
  1102. .name = "uart1",
  1103. .groups = uart1_grps,
  1104. .ngroups = ARRAY_SIZE(uart1_grps),
  1105. };
  1106. /* Pad multiplexing for uart2_3 device */
  1107. static const unsigned uart2_3_pins[] = { 104, 105, 106, 107 };
  1108. static struct spear_muxreg uart2_3_muxreg[] = {
  1109. {
  1110. .reg = PAD_FUNCTION_EN_0,
  1111. .mask = PMX_I2S0_MASK,
  1112. .val = 0,
  1113. },
  1114. };
  1115. static struct spear_modemux uart2_3_modemux[] = {
  1116. {
  1117. .muxregs = uart2_3_muxreg,
  1118. .nmuxregs = ARRAY_SIZE(uart2_3_muxreg),
  1119. },
  1120. };
  1121. static struct spear_pingroup uart_2_3_pingroup = {
  1122. .name = "uart2_3_grp",
  1123. .pins = uart2_3_pins,
  1124. .npins = ARRAY_SIZE(uart2_3_pins),
  1125. .modemuxs = uart2_3_modemux,
  1126. .nmodemuxs = ARRAY_SIZE(uart2_3_modemux),
  1127. };
  1128. static const char *const uart2_3_grps[] = { "uart2_3_grp" };
  1129. static struct spear_function uart2_3_function = {
  1130. .name = "uart2_3",
  1131. .groups = uart2_3_grps,
  1132. .ngroups = ARRAY_SIZE(uart2_3_grps),
  1133. };
  1134. /* Pad multiplexing for uart4 device */
  1135. static const unsigned uart4_pins[] = { 108, 113 };
  1136. static struct spear_muxreg uart4_muxreg[] = {
  1137. {
  1138. .reg = PAD_FUNCTION_EN_0,
  1139. .mask = PMX_I2S0_MASK | PMX_CLCD1_MASK,
  1140. .val = 0,
  1141. },
  1142. };
  1143. static struct spear_modemux uart4_modemux[] = {
  1144. {
  1145. .muxregs = uart4_muxreg,
  1146. .nmuxregs = ARRAY_SIZE(uart4_muxreg),
  1147. },
  1148. };
  1149. static struct spear_pingroup uart_4_pingroup = {
  1150. .name = "uart4_grp",
  1151. .pins = uart4_pins,
  1152. .npins = ARRAY_SIZE(uart4_pins),
  1153. .modemuxs = uart4_modemux,
  1154. .nmodemuxs = ARRAY_SIZE(uart4_modemux),
  1155. };
  1156. static const char *const uart4_grps[] = { "uart4_grp" };
  1157. static struct spear_function uart4_function = {
  1158. .name = "uart4",
  1159. .groups = uart4_grps,
  1160. .ngroups = ARRAY_SIZE(uart4_grps),
  1161. };
  1162. /* Pad multiplexing for uart5 device */
  1163. static const unsigned uart5_pins[] = { 114, 115 };
  1164. static struct spear_muxreg uart5_muxreg[] = {
  1165. {
  1166. .reg = PAD_FUNCTION_EN_0,
  1167. .mask = PMX_CLCD1_MASK,
  1168. .val = 0,
  1169. },
  1170. };
  1171. static struct spear_modemux uart5_modemux[] = {
  1172. {
  1173. .muxregs = uart5_muxreg,
  1174. .nmuxregs = ARRAY_SIZE(uart5_muxreg),
  1175. },
  1176. };
  1177. static struct spear_pingroup uart_5_pingroup = {
  1178. .name = "uart5_grp",
  1179. .pins = uart5_pins,
  1180. .npins = ARRAY_SIZE(uart5_pins),
  1181. .modemuxs = uart5_modemux,
  1182. .nmodemuxs = ARRAY_SIZE(uart5_modemux),
  1183. };
  1184. static const char *const uart5_grps[] = { "uart5_grp" };
  1185. static struct spear_function uart5_function = {
  1186. .name = "uart5",
  1187. .groups = uart5_grps,
  1188. .ngroups = ARRAY_SIZE(uart5_grps),
  1189. };
  1190. /* Pad multiplexing for rs485_0_1_tdm_0_1 device */
  1191. static const unsigned rs485_0_1_tdm_0_1_pins[] = { 116, 117, 118, 119, 120, 121,
  1192. 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
  1193. 136, 137 };
  1194. static struct spear_muxreg rs485_0_1_tdm_0_1_muxreg[] = {
  1195. {
  1196. .reg = PAD_FUNCTION_EN_0,
  1197. .mask = PMX_CLCD1_MASK,
  1198. .val = 0,
  1199. },
  1200. };
  1201. static struct spear_modemux rs485_0_1_tdm_0_1_modemux[] = {
  1202. {
  1203. .muxregs = rs485_0_1_tdm_0_1_muxreg,
  1204. .nmuxregs = ARRAY_SIZE(rs485_0_1_tdm_0_1_muxreg),
  1205. },
  1206. };
  1207. static struct spear_pingroup rs485_0_1_tdm_0_1_pingroup = {
  1208. .name = "rs485_0_1_tdm_0_1_grp",
  1209. .pins = rs485_0_1_tdm_0_1_pins,
  1210. .npins = ARRAY_SIZE(rs485_0_1_tdm_0_1_pins),
  1211. .modemuxs = rs485_0_1_tdm_0_1_modemux,
  1212. .nmodemuxs = ARRAY_SIZE(rs485_0_1_tdm_0_1_modemux),
  1213. };
  1214. static const char *const rs485_0_1_tdm_0_1_grps[] = { "rs485_0_1_tdm_0_1_grp" };
  1215. static struct spear_function rs485_0_1_tdm_0_1_function = {
  1216. .name = "rs485_0_1_tdm_0_1",
  1217. .groups = rs485_0_1_tdm_0_1_grps,
  1218. .ngroups = ARRAY_SIZE(rs485_0_1_tdm_0_1_grps),
  1219. };
  1220. /* Pad multiplexing for i2c_1_2 device */
  1221. static const unsigned i2c_1_2_pins[] = { 138, 139, 140, 141 };
  1222. static struct spear_muxreg i2c_1_2_muxreg[] = {
  1223. {
  1224. .reg = PAD_FUNCTION_EN_0,
  1225. .mask = PMX_CLCD1_MASK,
  1226. .val = 0,
  1227. },
  1228. };
  1229. static struct spear_modemux i2c_1_2_modemux[] = {
  1230. {
  1231. .muxregs = i2c_1_2_muxreg,
  1232. .nmuxregs = ARRAY_SIZE(i2c_1_2_muxreg),
  1233. },
  1234. };
  1235. static struct spear_pingroup i2c_1_2_pingroup = {
  1236. .name = "i2c_1_2_grp",
  1237. .pins = i2c_1_2_pins,
  1238. .npins = ARRAY_SIZE(i2c_1_2_pins),
  1239. .modemuxs = i2c_1_2_modemux,
  1240. .nmodemuxs = ARRAY_SIZE(i2c_1_2_modemux),
  1241. };
  1242. static const char *const i2c_1_2_grps[] = { "i2c_1_2_grp" };
  1243. static struct spear_function i2c_1_2_function = {
  1244. .name = "i2c_1_2",
  1245. .groups = i2c_1_2_grps,
  1246. .ngroups = ARRAY_SIZE(i2c_1_2_grps),
  1247. };
  1248. /* Pad multiplexing for i2c3_dis_smi_clcd device */
  1249. /* Muxed with SMI & CLCD */
  1250. static const unsigned i2c3_dis_smi_clcd_pins[] = { 142, 153 };
  1251. static struct spear_muxreg i2c3_dis_smi_clcd_muxreg[] = {
  1252. {
  1253. .reg = PAD_FUNCTION_EN_0,
  1254. .mask = PMX_CLCD1_MASK | PMX_SMI_MASK,
  1255. .val = 0,
  1256. },
  1257. };
  1258. static struct spear_modemux i2c3_dis_smi_clcd_modemux[] = {
  1259. {
  1260. .muxregs = i2c3_dis_smi_clcd_muxreg,
  1261. .nmuxregs = ARRAY_SIZE(i2c3_dis_smi_clcd_muxreg),
  1262. },
  1263. };
  1264. static struct spear_pingroup i2c3_dis_smi_clcd_pingroup = {
  1265. .name = "i2c3_dis_smi_clcd_grp",
  1266. .pins = i2c3_dis_smi_clcd_pins,
  1267. .npins = ARRAY_SIZE(i2c3_dis_smi_clcd_pins),
  1268. .modemuxs = i2c3_dis_smi_clcd_modemux,
  1269. .nmodemuxs = ARRAY_SIZE(i2c3_dis_smi_clcd_modemux),
  1270. };
  1271. /* Pad multiplexing for i2c3_dis_sd_i2s0 device */
  1272. /* Muxed with SD/MMC & I2S1 */
  1273. static const unsigned i2c3_dis_sd_i2s0_pins[] = { 0, 216 };
  1274. static struct spear_muxreg i2c3_dis_sd_i2s0_muxreg[] = {
  1275. {
  1276. .reg = PAD_FUNCTION_EN_1,
  1277. .mask = PMX_I2S1_MASK | PMX_MCIDATA3_MASK,
  1278. .val = 0,
  1279. },
  1280. };
  1281. static struct spear_modemux i2c3_dis_sd_i2s0_modemux[] = {
  1282. {
  1283. .muxregs = i2c3_dis_sd_i2s0_muxreg,
  1284. .nmuxregs = ARRAY_SIZE(i2c3_dis_sd_i2s0_muxreg),
  1285. },
  1286. };
  1287. static struct spear_pingroup i2c3_dis_sd_i2s0_pingroup = {
  1288. .name = "i2c3_dis_sd_i2s0_grp",
  1289. .pins = i2c3_dis_sd_i2s0_pins,
  1290. .npins = ARRAY_SIZE(i2c3_dis_sd_i2s0_pins),
  1291. .modemuxs = i2c3_dis_sd_i2s0_modemux,
  1292. .nmodemuxs = ARRAY_SIZE(i2c3_dis_sd_i2s0_modemux),
  1293. };
  1294. static const char *const i2c3_grps[] = { "i2c3_dis_smi_clcd_grp",
  1295. "i2c3_dis_sd_i2s0_grp" };
  1296. static struct spear_function i2c3_unction = {
  1297. .name = "i2c3_i2s1",
  1298. .groups = i2c3_grps,
  1299. .ngroups = ARRAY_SIZE(i2c3_grps),
  1300. };
  1301. /* Pad multiplexing for i2c_4_5_dis_smi device */
  1302. /* Muxed with SMI */
  1303. static const unsigned i2c_4_5_dis_smi_pins[] = { 154, 155, 156, 157 };
  1304. static struct spear_muxreg i2c_4_5_dis_smi_muxreg[] = {
  1305. {
  1306. .reg = PAD_FUNCTION_EN_0,
  1307. .mask = PMX_SMI_MASK,
  1308. .val = 0,
  1309. },
  1310. };
  1311. static struct spear_modemux i2c_4_5_dis_smi_modemux[] = {
  1312. {
  1313. .muxregs = i2c_4_5_dis_smi_muxreg,
  1314. .nmuxregs = ARRAY_SIZE(i2c_4_5_dis_smi_muxreg),
  1315. },
  1316. };
  1317. static struct spear_pingroup i2c_4_5_dis_smi_pingroup = {
  1318. .name = "i2c_4_5_dis_smi_grp",
  1319. .pins = i2c_4_5_dis_smi_pins,
  1320. .npins = ARRAY_SIZE(i2c_4_5_dis_smi_pins),
  1321. .modemuxs = i2c_4_5_dis_smi_modemux,
  1322. .nmodemuxs = ARRAY_SIZE(i2c_4_5_dis_smi_modemux),
  1323. };
  1324. /* Pad multiplexing for i2c4_dis_sd device */
  1325. /* Muxed with SD/MMC */
  1326. static const unsigned i2c4_dis_sd_pins[] = { 217, 218 };
  1327. static struct spear_muxreg i2c4_dis_sd_muxreg[] = {
  1328. {
  1329. .reg = PAD_FUNCTION_EN_1,
  1330. .mask = PMX_MCIDATA4_MASK,
  1331. .val = 0,
  1332. }, {
  1333. .reg = PAD_FUNCTION_EN_2,
  1334. .mask = PMX_MCIDATA5_MASK,
  1335. .val = 0,
  1336. },
  1337. };
  1338. static struct spear_modemux i2c4_dis_sd_modemux[] = {
  1339. {
  1340. .muxregs = i2c4_dis_sd_muxreg,
  1341. .nmuxregs = ARRAY_SIZE(i2c4_dis_sd_muxreg),
  1342. },
  1343. };
  1344. static struct spear_pingroup i2c4_dis_sd_pingroup = {
  1345. .name = "i2c4_dis_sd_grp",
  1346. .pins = i2c4_dis_sd_pins,
  1347. .npins = ARRAY_SIZE(i2c4_dis_sd_pins),
  1348. .modemuxs = i2c4_dis_sd_modemux,
  1349. .nmodemuxs = ARRAY_SIZE(i2c4_dis_sd_modemux),
  1350. };
  1351. /* Pad multiplexing for i2c5_dis_sd device */
  1352. /* Muxed with SD/MMC */
  1353. static const unsigned i2c5_dis_sd_pins[] = { 219, 220 };
  1354. static struct spear_muxreg i2c5_dis_sd_muxreg[] = {
  1355. {
  1356. .reg = PAD_FUNCTION_EN_2,
  1357. .mask = PMX_MCIDATA6_MASK |
  1358. PMX_MCIDATA7_MASK,
  1359. .val = 0,
  1360. },
  1361. };
  1362. static struct spear_modemux i2c5_dis_sd_modemux[] = {
  1363. {
  1364. .muxregs = i2c5_dis_sd_muxreg,
  1365. .nmuxregs = ARRAY_SIZE(i2c5_dis_sd_muxreg),
  1366. },
  1367. };
  1368. static struct spear_pingroup i2c5_dis_sd_pingroup = {
  1369. .name = "i2c5_dis_sd_grp",
  1370. .pins = i2c5_dis_sd_pins,
  1371. .npins = ARRAY_SIZE(i2c5_dis_sd_pins),
  1372. .modemuxs = i2c5_dis_sd_modemux,
  1373. .nmodemuxs = ARRAY_SIZE(i2c5_dis_sd_modemux),
  1374. };
  1375. static const char *const i2c_4_5_grps[] = { "i2c5_dis_sd_grp",
  1376. "i2c4_dis_sd_grp", "i2c_4_5_dis_smi_grp" };
  1377. static struct spear_function i2c_4_5_function = {
  1378. .name = "i2c_4_5",
  1379. .groups = i2c_4_5_grps,
  1380. .ngroups = ARRAY_SIZE(i2c_4_5_grps),
  1381. };
  1382. /* Pad multiplexing for i2c_6_7_dis_kbd device */
  1383. /* Muxed with KBD */
  1384. static const unsigned i2c_6_7_dis_kbd_pins[] = { 207, 208, 209, 210 };
  1385. static struct spear_muxreg i2c_6_7_dis_kbd_muxreg[] = {
  1386. {
  1387. .reg = PAD_FUNCTION_EN_1,
  1388. .mask = PMX_KBD_ROWCOL25_MASK,
  1389. .val = 0,
  1390. },
  1391. };
  1392. static struct spear_modemux i2c_6_7_dis_kbd_modemux[] = {
  1393. {
  1394. .muxregs = i2c_6_7_dis_kbd_muxreg,
  1395. .nmuxregs = ARRAY_SIZE(i2c_6_7_dis_kbd_muxreg),
  1396. },
  1397. };
  1398. static struct spear_pingroup i2c_6_7_dis_kbd_pingroup = {
  1399. .name = "i2c_6_7_dis_kbd_grp",
  1400. .pins = i2c_6_7_dis_kbd_pins,
  1401. .npins = ARRAY_SIZE(i2c_6_7_dis_kbd_pins),
  1402. .modemuxs = i2c_6_7_dis_kbd_modemux,
  1403. .nmodemuxs = ARRAY_SIZE(i2c_6_7_dis_kbd_modemux),
  1404. };
  1405. /* Pad multiplexing for i2c6_dis_sd device */
  1406. /* Muxed with SD/MMC */
  1407. static const unsigned i2c6_dis_sd_pins[] = { 236, 237 };
  1408. static struct spear_muxreg i2c6_dis_sd_muxreg[] = {
  1409. {
  1410. .reg = PAD_FUNCTION_EN_2,
  1411. .mask = PMX_MCIIORDRE_MASK |
  1412. PMX_MCIIOWRWE_MASK,
  1413. .val = 0,
  1414. },
  1415. };
  1416. static struct spear_modemux i2c6_dis_sd_modemux[] = {
  1417. {
  1418. .muxregs = i2c6_dis_sd_muxreg,
  1419. .nmuxregs = ARRAY_SIZE(i2c6_dis_sd_muxreg),
  1420. },
  1421. };
  1422. static struct spear_pingroup i2c6_dis_sd_pingroup = {
  1423. .name = "i2c6_dis_sd_grp",
  1424. .pins = i2c6_dis_sd_pins,
  1425. .npins = ARRAY_SIZE(i2c6_dis_sd_pins),
  1426. .modemuxs = i2c6_dis_sd_modemux,
  1427. .nmodemuxs = ARRAY_SIZE(i2c6_dis_sd_modemux),
  1428. };
  1429. /* Pad multiplexing for i2c7_dis_sd device */
  1430. static const unsigned i2c7_dis_sd_pins[] = { 238, 239 };
  1431. static struct spear_muxreg i2c7_dis_sd_muxreg[] = {
  1432. {
  1433. .reg = PAD_FUNCTION_EN_2,
  1434. .mask = PMX_MCIRESETCF_MASK |
  1435. PMX_MCICS0CE_MASK,
  1436. .val = 0,
  1437. },
  1438. };
  1439. static struct spear_modemux i2c7_dis_sd_modemux[] = {
  1440. {
  1441. .muxregs = i2c7_dis_sd_muxreg,
  1442. .nmuxregs = ARRAY_SIZE(i2c7_dis_sd_muxreg),
  1443. },
  1444. };
  1445. static struct spear_pingroup i2c7_dis_sd_pingroup = {
  1446. .name = "i2c7_dis_sd_grp",
  1447. .pins = i2c7_dis_sd_pins,
  1448. .npins = ARRAY_SIZE(i2c7_dis_sd_pins),
  1449. .modemuxs = i2c7_dis_sd_modemux,
  1450. .nmodemuxs = ARRAY_SIZE(i2c7_dis_sd_modemux),
  1451. };
  1452. static const char *const i2c_6_7_grps[] = { "i2c6_dis_sd_grp",
  1453. "i2c7_dis_sd_grp", "i2c_6_7_dis_kbd_grp" };
  1454. static struct spear_function i2c_6_7_function = {
  1455. .name = "i2c_6_7",
  1456. .groups = i2c_6_7_grps,
  1457. .ngroups = ARRAY_SIZE(i2c_6_7_grps),
  1458. };
  1459. /* Pad multiplexing for can0_dis_nor device */
  1460. /* Muxed with NOR */
  1461. static const unsigned can0_dis_nor_pins[] = { 56, 57 };
  1462. static struct spear_muxreg can0_dis_nor_muxreg[] = {
  1463. {
  1464. .reg = PAD_FUNCTION_EN_0,
  1465. .mask = PMX_NFRSTPWDWN2_MASK,
  1466. .val = 0,
  1467. }, {
  1468. .reg = PAD_FUNCTION_EN_1,
  1469. .mask = PMX_NFRSTPWDWN3_MASK,
  1470. .val = 0,
  1471. },
  1472. };
  1473. static struct spear_modemux can0_dis_nor_modemux[] = {
  1474. {
  1475. .muxregs = can0_dis_nor_muxreg,
  1476. .nmuxregs = ARRAY_SIZE(can0_dis_nor_muxreg),
  1477. },
  1478. };
  1479. static struct spear_pingroup can0_dis_nor_pingroup = {
  1480. .name = "can0_dis_nor_grp",
  1481. .pins = can0_dis_nor_pins,
  1482. .npins = ARRAY_SIZE(can0_dis_nor_pins),
  1483. .modemuxs = can0_dis_nor_modemux,
  1484. .nmodemuxs = ARRAY_SIZE(can0_dis_nor_modemux),
  1485. };
  1486. /* Pad multiplexing for can0_dis_sd device */
  1487. /* Muxed with SD/MMC */
  1488. static const unsigned can0_dis_sd_pins[] = { 240, 241 };
  1489. static struct spear_muxreg can0_dis_sd_muxreg[] = {
  1490. {
  1491. .reg = PAD_FUNCTION_EN_2,
  1492. .mask = PMX_MCICFINTR_MASK | PMX_MCIIORDY_MASK,
  1493. .val = 0,
  1494. },
  1495. };
  1496. static struct spear_modemux can0_dis_sd_modemux[] = {
  1497. {
  1498. .muxregs = can0_dis_sd_muxreg,
  1499. .nmuxregs = ARRAY_SIZE(can0_dis_sd_muxreg),
  1500. },
  1501. };
  1502. static struct spear_pingroup can0_dis_sd_pingroup = {
  1503. .name = "can0_dis_sd_grp",
  1504. .pins = can0_dis_sd_pins,
  1505. .npins = ARRAY_SIZE(can0_dis_sd_pins),
  1506. .modemuxs = can0_dis_sd_modemux,
  1507. .nmodemuxs = ARRAY_SIZE(can0_dis_sd_modemux),
  1508. };
  1509. static const char *const can0_grps[] = { "can0_dis_nor_grp", "can0_dis_sd_grp"
  1510. };
  1511. static struct spear_function can0_function = {
  1512. .name = "can0",
  1513. .groups = can0_grps,
  1514. .ngroups = ARRAY_SIZE(can0_grps),
  1515. };
  1516. /* Pad multiplexing for can1_dis_sd device */
  1517. /* Muxed with SD/MMC */
  1518. static const unsigned can1_dis_sd_pins[] = { 242, 243 };
  1519. static struct spear_muxreg can1_dis_sd_muxreg[] = {
  1520. {
  1521. .reg = PAD_FUNCTION_EN_2,
  1522. .mask = PMX_MCICS1_MASK | PMX_MCIDMAACK_MASK,
  1523. .val = 0,
  1524. },
  1525. };
  1526. static struct spear_modemux can1_dis_sd_modemux[] = {
  1527. {
  1528. .muxregs = can1_dis_sd_muxreg,
  1529. .nmuxregs = ARRAY_SIZE(can1_dis_sd_muxreg),
  1530. },
  1531. };
  1532. static struct spear_pingroup can1_dis_sd_pingroup = {
  1533. .name = "can1_dis_sd_grp",
  1534. .pins = can1_dis_sd_pins,
  1535. .npins = ARRAY_SIZE(can1_dis_sd_pins),
  1536. .modemuxs = can1_dis_sd_modemux,
  1537. .nmodemuxs = ARRAY_SIZE(can1_dis_sd_modemux),
  1538. };
  1539. /* Pad multiplexing for can1_dis_kbd device */
  1540. /* Muxed with KBD */
  1541. static const unsigned can1_dis_kbd_pins[] = { 201, 202 };
  1542. static struct spear_muxreg can1_dis_kbd_muxreg[] = {
  1543. {
  1544. .reg = PAD_FUNCTION_EN_1,
  1545. .mask = PMX_KBD_ROWCOL25_MASK,
  1546. .val = 0,
  1547. },
  1548. };
  1549. static struct spear_modemux can1_dis_kbd_modemux[] = {
  1550. {
  1551. .muxregs = can1_dis_kbd_muxreg,
  1552. .nmuxregs = ARRAY_SIZE(can1_dis_kbd_muxreg),
  1553. },
  1554. };
  1555. static struct spear_pingroup can1_dis_kbd_pingroup = {
  1556. .name = "can1_dis_kbd_grp",
  1557. .pins = can1_dis_kbd_pins,
  1558. .npins = ARRAY_SIZE(can1_dis_kbd_pins),
  1559. .modemuxs = can1_dis_kbd_modemux,
  1560. .nmodemuxs = ARRAY_SIZE(can1_dis_kbd_modemux),
  1561. };
  1562. static const char *const can1_grps[] = { "can1_dis_sd_grp", "can1_dis_kbd_grp"
  1563. };
  1564. static struct spear_function can1_function = {
  1565. .name = "can1",
  1566. .groups = can1_grps,
  1567. .ngroups = ARRAY_SIZE(can1_grps),
  1568. };
  1569. /* Pad multiplexing for pci device */
  1570. static const unsigned pci_sata_pins[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 18,
  1571. 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
  1572. 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
  1573. 55, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 };
  1574. #define PCI_SATA_MUXREG \
  1575. { \
  1576. .reg = PAD_FUNCTION_EN_0, \
  1577. .mask = PMX_MCI_DATA8_15_MASK, \
  1578. .val = 0, \
  1579. }, { \
  1580. .reg = PAD_FUNCTION_EN_1, \
  1581. .mask = PMX_PCI_REG1_MASK, \
  1582. .val = 0, \
  1583. }, { \
  1584. .reg = PAD_FUNCTION_EN_2, \
  1585. .mask = PMX_PCI_REG2_MASK, \
  1586. .val = 0, \
  1587. }
  1588. /* pad multiplexing for pcie0 device */
  1589. static struct spear_muxreg pcie0_muxreg[] = {
  1590. PCI_SATA_MUXREG,
  1591. {
  1592. .reg = PCIE_SATA_CFG,
  1593. .mask = PCIE_CFG_VAL(0),
  1594. .val = PCIE_CFG_VAL(0),
  1595. },
  1596. };
  1597. static struct spear_modemux pcie0_modemux[] = {
  1598. {
  1599. .muxregs = pcie0_muxreg,
  1600. .nmuxregs = ARRAY_SIZE(pcie0_muxreg),
  1601. },
  1602. };
  1603. static struct spear_pingroup pcie0_pingroup = {
  1604. .name = "pcie0_grp",
  1605. .pins = pci_sata_pins,
  1606. .npins = ARRAY_SIZE(pci_sata_pins),
  1607. .modemuxs = pcie0_modemux,
  1608. .nmodemuxs = ARRAY_SIZE(pcie0_modemux),
  1609. };
  1610. /* pad multiplexing for pcie1 device */
  1611. static struct spear_muxreg pcie1_muxreg[] = {
  1612. PCI_SATA_MUXREG,
  1613. {
  1614. .reg = PCIE_SATA_CFG,
  1615. .mask = PCIE_CFG_VAL(1),
  1616. .val = PCIE_CFG_VAL(1),
  1617. },
  1618. };
  1619. static struct spear_modemux pcie1_modemux[] = {
  1620. {
  1621. .muxregs = pcie1_muxreg,
  1622. .nmuxregs = ARRAY_SIZE(pcie1_muxreg),
  1623. },
  1624. };
  1625. static struct spear_pingroup pcie1_pingroup = {
  1626. .name = "pcie1_grp",
  1627. .pins = pci_sata_pins,
  1628. .npins = ARRAY_SIZE(pci_sata_pins),
  1629. .modemuxs = pcie1_modemux,
  1630. .nmodemuxs = ARRAY_SIZE(pcie1_modemux),
  1631. };
  1632. /* pad multiplexing for pcie2 device */
  1633. static struct spear_muxreg pcie2_muxreg[] = {
  1634. PCI_SATA_MUXREG,
  1635. {
  1636. .reg = PCIE_SATA_CFG,
  1637. .mask = PCIE_CFG_VAL(2),
  1638. .val = PCIE_CFG_VAL(2),
  1639. },
  1640. };
  1641. static struct spear_modemux pcie2_modemux[] = {
  1642. {
  1643. .muxregs = pcie2_muxreg,
  1644. .nmuxregs = ARRAY_SIZE(pcie2_muxreg),
  1645. },
  1646. };
  1647. static struct spear_pingroup pcie2_pingroup = {
  1648. .name = "pcie2_grp",
  1649. .pins = pci_sata_pins,
  1650. .npins = ARRAY_SIZE(pci_sata_pins),
  1651. .modemuxs = pcie2_modemux,
  1652. .nmodemuxs = ARRAY_SIZE(pcie2_modemux),
  1653. };
  1654. static const char *const pci_grps[] = { "pcie0_grp", "pcie1_grp", "pcie2_grp" };
  1655. static struct spear_function pci_function = {
  1656. .name = "pci",
  1657. .groups = pci_grps,
  1658. .ngroups = ARRAY_SIZE(pci_grps),
  1659. };
  1660. /* pad multiplexing for sata0 device */
  1661. static struct spear_muxreg sata0_muxreg[] = {
  1662. PCI_SATA_MUXREG,
  1663. {
  1664. .reg = PCIE_SATA_CFG,
  1665. .mask = SATA_CFG_VAL(0),
  1666. .val = SATA_CFG_VAL(0),
  1667. },
  1668. };
  1669. static struct spear_modemux sata0_modemux[] = {
  1670. {
  1671. .muxregs = sata0_muxreg,
  1672. .nmuxregs = ARRAY_SIZE(sata0_muxreg),
  1673. },
  1674. };
  1675. static struct spear_pingroup sata0_pingroup = {
  1676. .name = "sata0_grp",
  1677. .pins = pci_sata_pins,
  1678. .npins = ARRAY_SIZE(pci_sata_pins),
  1679. .modemuxs = sata0_modemux,
  1680. .nmodemuxs = ARRAY_SIZE(sata0_modemux),
  1681. };
  1682. /* pad multiplexing for sata1 device */
  1683. static struct spear_muxreg sata1_muxreg[] = {
  1684. PCI_SATA_MUXREG,
  1685. {
  1686. .reg = PCIE_SATA_CFG,
  1687. .mask = SATA_CFG_VAL(1),
  1688. .val = SATA_CFG_VAL(1),
  1689. },
  1690. };
  1691. static struct spear_modemux sata1_modemux[] = {
  1692. {
  1693. .muxregs = sata1_muxreg,
  1694. .nmuxregs = ARRAY_SIZE(sata1_muxreg),
  1695. },
  1696. };
  1697. static struct spear_pingroup sata1_pingroup = {
  1698. .name = "sata1_grp",
  1699. .pins = pci_sata_pins,
  1700. .npins = ARRAY_SIZE(pci_sata_pins),
  1701. .modemuxs = sata1_modemux,
  1702. .nmodemuxs = ARRAY_SIZE(sata1_modemux),
  1703. };
  1704. /* pad multiplexing for sata2 device */
  1705. static struct spear_muxreg sata2_muxreg[] = {
  1706. PCI_SATA_MUXREG,
  1707. {
  1708. .reg = PCIE_SATA_CFG,
  1709. .mask = SATA_CFG_VAL(2),
  1710. .val = SATA_CFG_VAL(2),
  1711. },
  1712. };
  1713. static struct spear_modemux sata2_modemux[] = {
  1714. {
  1715. .muxregs = sata2_muxreg,
  1716. .nmuxregs = ARRAY_SIZE(sata2_muxreg),
  1717. },
  1718. };
  1719. static struct spear_pingroup sata2_pingroup = {
  1720. .name = "sata2_grp",
  1721. .pins = pci_sata_pins,
  1722. .npins = ARRAY_SIZE(pci_sata_pins),
  1723. .modemuxs = sata2_modemux,
  1724. .nmodemuxs = ARRAY_SIZE(sata2_modemux),
  1725. };
  1726. static const char *const sata_grps[] = { "sata0_grp", "sata1_grp", "sata2_grp"
  1727. };
  1728. static struct spear_function sata_function = {
  1729. .name = "sata",
  1730. .groups = sata_grps,
  1731. .ngroups = ARRAY_SIZE(sata_grps),
  1732. };
  1733. /* Pad multiplexing for ssp1_dis_kbd device */
  1734. static const unsigned ssp1_dis_kbd_pins[] = { 203, 204, 205, 206 };
  1735. static struct spear_muxreg ssp1_dis_kbd_muxreg[] = {
  1736. {
  1737. .reg = PAD_FUNCTION_EN_1,
  1738. .mask = PMX_KBD_ROWCOL25_MASK | PMX_KBD_COL1_MASK |
  1739. PMX_KBD_COL0_MASK | PMX_NFIO8_15_MASK | PMX_NFCE1_MASK |
  1740. PMX_NFCE2_MASK,
  1741. .val = 0,
  1742. },
  1743. };
  1744. static struct spear_modemux ssp1_dis_kbd_modemux[] = {
  1745. {
  1746. .muxregs = ssp1_dis_kbd_muxreg,
  1747. .nmuxregs = ARRAY_SIZE(ssp1_dis_kbd_muxreg),
  1748. },
  1749. };
  1750. static struct spear_pingroup ssp1_dis_kbd_pingroup = {
  1751. .name = "ssp1_dis_kbd_grp",
  1752. .pins = ssp1_dis_kbd_pins,
  1753. .npins = ARRAY_SIZE(ssp1_dis_kbd_pins),
  1754. .modemuxs = ssp1_dis_kbd_modemux,
  1755. .nmodemuxs = ARRAY_SIZE(ssp1_dis_kbd_modemux),
  1756. };
  1757. /* Pad multiplexing for ssp1_dis_sd device */
  1758. static const unsigned ssp1_dis_sd_pins[] = { 224, 226, 227, 228 };
  1759. static struct spear_muxreg ssp1_dis_sd_muxreg[] = {
  1760. {
  1761. .reg = PAD_FUNCTION_EN_2,
  1762. .mask = PMX_MCIADDR0ALE_MASK | PMX_MCIADDR2_MASK |
  1763. PMX_MCICECF_MASK | PMX_MCICEXD_MASK,
  1764. .val = 0,
  1765. },
  1766. };
  1767. static struct spear_modemux ssp1_dis_sd_modemux[] = {
  1768. {
  1769. .muxregs = ssp1_dis_sd_muxreg,
  1770. .nmuxregs = ARRAY_SIZE(ssp1_dis_sd_muxreg),
  1771. },
  1772. };
  1773. static struct spear_pingroup ssp1_dis_sd_pingroup = {
  1774. .name = "ssp1_dis_sd_grp",
  1775. .pins = ssp1_dis_sd_pins,
  1776. .npins = ARRAY_SIZE(ssp1_dis_sd_pins),
  1777. .modemuxs = ssp1_dis_sd_modemux,
  1778. .nmodemuxs = ARRAY_SIZE(ssp1_dis_sd_modemux),
  1779. };
  1780. static const char *const ssp1_grps[] = { "ssp1_dis_kbd_grp",
  1781. "ssp1_dis_sd_grp" };
  1782. static struct spear_function ssp1_function = {
  1783. .name = "ssp1",
  1784. .groups = ssp1_grps,
  1785. .ngroups = ARRAY_SIZE(ssp1_grps),
  1786. };
  1787. /* Pad multiplexing for gpt64 device */
  1788. static const unsigned gpt64_pins[] = { 230, 231, 232, 245 };
  1789. static struct spear_muxreg gpt64_muxreg[] = {
  1790. {
  1791. .reg = PAD_FUNCTION_EN_2,
  1792. .mask = PMX_MCICDCF1_MASK | PMX_MCICDCF2_MASK | PMX_MCICDXD_MASK
  1793. | PMX_MCILEDS_MASK,
  1794. .val = 0,
  1795. },
  1796. };
  1797. static struct spear_modemux gpt64_modemux[] = {
  1798. {
  1799. .muxregs = gpt64_muxreg,
  1800. .nmuxregs = ARRAY_SIZE(gpt64_muxreg),
  1801. },
  1802. };
  1803. static struct spear_pingroup gpt64_pingroup = {
  1804. .name = "gpt64_grp",
  1805. .pins = gpt64_pins,
  1806. .npins = ARRAY_SIZE(gpt64_pins),
  1807. .modemuxs = gpt64_modemux,
  1808. .nmodemuxs = ARRAY_SIZE(gpt64_modemux),
  1809. };
  1810. static const char *const gpt64_grps[] = { "gpt64_grp" };
  1811. static struct spear_function gpt64_function = {
  1812. .name = "gpt64",
  1813. .groups = gpt64_grps,
  1814. .ngroups = ARRAY_SIZE(gpt64_grps),
  1815. };
  1816. /* pingroups */
  1817. static struct spear_pingroup *spear1310_pingroups[] = {
  1818. &i2c0_pingroup,
  1819. &ssp0_pingroup,
  1820. &i2s0_pingroup,
  1821. &i2s1_pingroup,
  1822. &clcd_pingroup,
  1823. &clcd_high_res_pingroup,
  1824. &arm_gpio_pingroup,
  1825. &smi_2_chips_pingroup,
  1826. &smi_4_chips_pingroup,
  1827. &gmii_pingroup,
  1828. &rgmii_pingroup,
  1829. &smii_0_1_2_pingroup,
  1830. &ras_mii_txclk_pingroup,
  1831. &nand_8bit_pingroup,
  1832. &nand_16bit_pingroup,
  1833. &nand_4_chips_pingroup,
  1834. &keyboard_6x6_pingroup,
  1835. &keyboard_rowcol6_8_pingroup,
  1836. &uart0_pingroup,
  1837. &uart0_modem_pingroup,
  1838. &gpt0_tmr0_pingroup,
  1839. &gpt0_tmr1_pingroup,
  1840. &gpt1_tmr0_pingroup,
  1841. &gpt1_tmr1_pingroup,
  1842. &sdhci_pingroup,
  1843. &cf_pingroup,
  1844. &xd_pingroup,
  1845. &touch_xy_pingroup,
  1846. &ssp0_cs0_pingroup,
  1847. &ssp0_cs1_2_pingroup,
  1848. &uart_1_dis_i2c_pingroup,
  1849. &uart_1_dis_sd_pingroup,
  1850. &uart_2_3_pingroup,
  1851. &uart_4_pingroup,
  1852. &uart_5_pingroup,
  1853. &rs485_0_1_tdm_0_1_pingroup,
  1854. &i2c_1_2_pingroup,
  1855. &i2c3_dis_smi_clcd_pingroup,
  1856. &i2c3_dis_sd_i2s0_pingroup,
  1857. &i2c_4_5_dis_smi_pingroup,
  1858. &i2c4_dis_sd_pingroup,
  1859. &i2c5_dis_sd_pingroup,
  1860. &i2c_6_7_dis_kbd_pingroup,
  1861. &i2c6_dis_sd_pingroup,
  1862. &i2c7_dis_sd_pingroup,
  1863. &can0_dis_nor_pingroup,
  1864. &can0_dis_sd_pingroup,
  1865. &can1_dis_sd_pingroup,
  1866. &can1_dis_kbd_pingroup,
  1867. &pcie0_pingroup,
  1868. &pcie1_pingroup,
  1869. &pcie2_pingroup,
  1870. &sata0_pingroup,
  1871. &sata1_pingroup,
  1872. &sata2_pingroup,
  1873. &ssp1_dis_kbd_pingroup,
  1874. &ssp1_dis_sd_pingroup,
  1875. &gpt64_pingroup,
  1876. };
  1877. /* functions */
  1878. static struct spear_function *spear1310_functions[] = {
  1879. &i2c0_function,
  1880. &ssp0_function,
  1881. &i2s0_function,
  1882. &i2s1_function,
  1883. &clcd_function,
  1884. &arm_gpio_function,
  1885. &smi_function,
  1886. &gmii_function,
  1887. &rgmii_function,
  1888. &smii_0_1_2_function,
  1889. &ras_mii_txclk_function,
  1890. &nand_function,
  1891. &keyboard_function,
  1892. &uart0_function,
  1893. &gpt0_function,
  1894. &gpt1_function,
  1895. &sdhci_function,
  1896. &cf_function,
  1897. &xd_function,
  1898. &touch_xy_function,
  1899. &uart1_function,
  1900. &uart2_3_function,
  1901. &uart4_function,
  1902. &uart5_function,
  1903. &rs485_0_1_tdm_0_1_function,
  1904. &i2c_1_2_function,
  1905. &i2c3_unction,
  1906. &i2c_4_5_function,
  1907. &i2c_6_7_function,
  1908. &can0_function,
  1909. &can1_function,
  1910. &pci_function,
  1911. &sata_function,
  1912. &ssp1_function,
  1913. &gpt64_function,
  1914. };
  1915. static struct spear_pinctrl_machdata spear1310_machdata = {
  1916. .pins = spear1310_pins,
  1917. .npins = ARRAY_SIZE(spear1310_pins),
  1918. .groups = spear1310_pingroups,
  1919. .ngroups = ARRAY_SIZE(spear1310_pingroups),
  1920. .functions = spear1310_functions,
  1921. .nfunctions = ARRAY_SIZE(spear1310_functions),
  1922. .modes_supported = false,
  1923. };
  1924. static struct of_device_id spear1310_pinctrl_of_match[] __devinitdata = {
  1925. {
  1926. .compatible = "st,spear1310-pinmux",
  1927. },
  1928. {},
  1929. };
  1930. static int __devinit spear1310_pinctrl_probe(struct platform_device *pdev)
  1931. {
  1932. return spear_pinctrl_probe(pdev, &spear1310_machdata);
  1933. }
  1934. static int __devexit spear1310_pinctrl_remove(struct platform_device *pdev)
  1935. {
  1936. return spear_pinctrl_remove(pdev);
  1937. }
  1938. static struct platform_driver spear1310_pinctrl_driver = {
  1939. .driver = {
  1940. .name = DRIVER_NAME,
  1941. .owner = THIS_MODULE,
  1942. .of_match_table = spear1310_pinctrl_of_match,
  1943. },
  1944. .probe = spear1310_pinctrl_probe,
  1945. .remove = __devexit_p(spear1310_pinctrl_remove),
  1946. };
  1947. static int __init spear1310_pinctrl_init(void)
  1948. {
  1949. return platform_driver_register(&spear1310_pinctrl_driver);
  1950. }
  1951. arch_initcall(spear1310_pinctrl_init);
  1952. static void __exit spear1310_pinctrl_exit(void)
  1953. {
  1954. platform_driver_unregister(&spear1310_pinctrl_driver);
  1955. }
  1956. module_exit(spear1310_pinctrl_exit);
  1957. MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>");
  1958. MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver");
  1959. MODULE_LICENSE("GPL v2");
  1960. MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match);