pinctrl-nomadik-db8540.c 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242
  1. #include <linux/kernel.h>
  2. #include <linux/pinctrl/pinctrl.h>
  3. #include "pinctrl-nomadik.h"
  4. /* All the pins that can be used for GPIO and some other functions */
  5. #define _GPIO(offset) (offset)
  6. #define DB8540_PIN_AH6 _GPIO(0)
  7. #define DB8540_PIN_AG7 _GPIO(1)
  8. #define DB8540_PIN_AF2 _GPIO(2)
  9. #define DB8540_PIN_AD3 _GPIO(3)
  10. #define DB8540_PIN_AF6 _GPIO(4)
  11. #define DB8540_PIN_AG6 _GPIO(5)
  12. #define DB8540_PIN_AD5 _GPIO(6)
  13. #define DB8540_PIN_AF7 _GPIO(7)
  14. #define DB8540_PIN_AG5 _GPIO(8)
  15. #define DB8540_PIN_AH5 _GPIO(9)
  16. #define DB8540_PIN_AE4 _GPIO(10)
  17. #define DB8540_PIN_AD1 _GPIO(11)
  18. #define DB8540_PIN_AD2 _GPIO(12)
  19. #define DB8540_PIN_AC2 _GPIO(13)
  20. #define DB8540_PIN_AC4 _GPIO(14)
  21. #define DB8540_PIN_AC3 _GPIO(15)
  22. #define DB8540_PIN_AH7 _GPIO(16)
  23. #define DB8540_PIN_AE7 _GPIO(17)
  24. /* Hole */
  25. #define DB8540_PIN_AF8 _GPIO(22)
  26. #define DB8540_PIN_AH11 _GPIO(23)
  27. #define DB8540_PIN_AG11 _GPIO(24)
  28. #define DB8540_PIN_AF11 _GPIO(25)
  29. #define DB8540_PIN_AH10 _GPIO(26)
  30. #define DB8540_PIN_AG10 _GPIO(27)
  31. #define DB8540_PIN_AF10 _GPIO(28)
  32. /* Hole */
  33. #define DB8540_PIN_AD4 _GPIO(33)
  34. #define DB8540_PIN_AF3 _GPIO(34)
  35. #define DB8540_PIN_AF5 _GPIO(35)
  36. #define DB8540_PIN_AG4 _GPIO(36)
  37. #define DB8540_PIN_AF9 _GPIO(37)
  38. #define DB8540_PIN_AE8 _GPIO(38)
  39. /* Hole */
  40. #define DB8540_PIN_M26 _GPIO(64)
  41. #define DB8540_PIN_M25 _GPIO(65)
  42. #define DB8540_PIN_M27 _GPIO(66)
  43. #define DB8540_PIN_N25 _GPIO(67)
  44. /* Hole */
  45. #define DB8540_PIN_M28 _GPIO(70)
  46. #define DB8540_PIN_N26 _GPIO(71)
  47. #define DB8540_PIN_M22 _GPIO(72)
  48. #define DB8540_PIN_N22 _GPIO(73)
  49. #define DB8540_PIN_N27 _GPIO(74)
  50. #define DB8540_PIN_N28 _GPIO(75)
  51. #define DB8540_PIN_P22 _GPIO(76)
  52. #define DB8540_PIN_P28 _GPIO(77)
  53. #define DB8540_PIN_P26 _GPIO(78)
  54. #define DB8540_PIN_T22 _GPIO(79)
  55. #define DB8540_PIN_R27 _GPIO(80)
  56. #define DB8540_PIN_P27 _GPIO(81)
  57. #define DB8540_PIN_R26 _GPIO(82)
  58. #define DB8540_PIN_R25 _GPIO(83)
  59. #define DB8540_PIN_U22 _GPIO(84)
  60. #define DB8540_PIN_T27 _GPIO(85)
  61. #define DB8540_PIN_T25 _GPIO(86)
  62. #define DB8540_PIN_T26 _GPIO(87)
  63. /* Hole */
  64. #define DB8540_PIN_AF20 _GPIO(116)
  65. #define DB8540_PIN_AG21 _GPIO(117)
  66. #define DB8540_PIN_AH19 _GPIO(118)
  67. #define DB8540_PIN_AE19 _GPIO(119)
  68. #define DB8540_PIN_AG18 _GPIO(120)
  69. #define DB8540_PIN_AH17 _GPIO(121)
  70. #define DB8540_PIN_AF19 _GPIO(122)
  71. #define DB8540_PIN_AF18 _GPIO(123)
  72. #define DB8540_PIN_AE18 _GPIO(124)
  73. #define DB8540_PIN_AG17 _GPIO(125)
  74. #define DB8540_PIN_AF17 _GPIO(126)
  75. #define DB8540_PIN_AE17 _GPIO(127)
  76. #define DB8540_PIN_AC27 _GPIO(128)
  77. #define DB8540_PIN_AD27 _GPIO(129)
  78. #define DB8540_PIN_AE28 _GPIO(130)
  79. #define DB8540_PIN_AG26 _GPIO(131)
  80. #define DB8540_PIN_AF25 _GPIO(132)
  81. #define DB8540_PIN_AE27 _GPIO(133)
  82. #define DB8540_PIN_AF27 _GPIO(134)
  83. #define DB8540_PIN_AG28 _GPIO(135)
  84. #define DB8540_PIN_AF28 _GPIO(136)
  85. #define DB8540_PIN_AG25 _GPIO(137)
  86. #define DB8540_PIN_AG24 _GPIO(138)
  87. #define DB8540_PIN_AD25 _GPIO(139)
  88. #define DB8540_PIN_AH25 _GPIO(140)
  89. #define DB8540_PIN_AF26 _GPIO(141)
  90. #define DB8540_PIN_AF23 _GPIO(142)
  91. #define DB8540_PIN_AG23 _GPIO(143)
  92. #define DB8540_PIN_AE25 _GPIO(144)
  93. #define DB8540_PIN_AH24 _GPIO(145)
  94. #define DB8540_PIN_AJ25 _GPIO(146)
  95. #define DB8540_PIN_AG27 _GPIO(147)
  96. #define DB8540_PIN_AH23 _GPIO(148)
  97. #define DB8540_PIN_AE26 _GPIO(149)
  98. #define DB8540_PIN_AE24 _GPIO(150)
  99. #define DB8540_PIN_AJ24 _GPIO(151)
  100. #define DB8540_PIN_AE21 _GPIO(152)
  101. #define DB8540_PIN_AG22 _GPIO(153)
  102. #define DB8540_PIN_AF21 _GPIO(154)
  103. #define DB8540_PIN_AF24 _GPIO(155)
  104. #define DB8540_PIN_AH22 _GPIO(156)
  105. #define DB8540_PIN_AJ23 _GPIO(157)
  106. #define DB8540_PIN_AH21 _GPIO(158)
  107. #define DB8540_PIN_AG20 _GPIO(159)
  108. #define DB8540_PIN_AE23 _GPIO(160)
  109. #define DB8540_PIN_AH20 _GPIO(161)
  110. #define DB8540_PIN_AG19 _GPIO(162)
  111. #define DB8540_PIN_AF22 _GPIO(163)
  112. #define DB8540_PIN_AJ21 _GPIO(164)
  113. #define DB8540_PIN_AD26 _GPIO(165)
  114. #define DB8540_PIN_AD28 _GPIO(166)
  115. #define DB8540_PIN_AC28 _GPIO(167)
  116. #define DB8540_PIN_AC26 _GPIO(168)
  117. /* Hole */
  118. #define DB8540_PIN_J3 _GPIO(192)
  119. #define DB8540_PIN_H1 _GPIO(193)
  120. #define DB8540_PIN_J2 _GPIO(194)
  121. #define DB8540_PIN_H2 _GPIO(195)
  122. #define DB8540_PIN_H3 _GPIO(196)
  123. #define DB8540_PIN_H4 _GPIO(197)
  124. #define DB8540_PIN_G2 _GPIO(198)
  125. #define DB8540_PIN_G3 _GPIO(199)
  126. #define DB8540_PIN_G4 _GPIO(200)
  127. #define DB8540_PIN_F2 _GPIO(201)
  128. #define DB8540_PIN_C6 _GPIO(202)
  129. #define DB8540_PIN_B6 _GPIO(203)
  130. #define DB8540_PIN_B7 _GPIO(204)
  131. #define DB8540_PIN_A7 _GPIO(205)
  132. #define DB8540_PIN_D7 _GPIO(206)
  133. #define DB8540_PIN_D8 _GPIO(207)
  134. #define DB8540_PIN_F3 _GPIO(208)
  135. #define DB8540_PIN_E2 _GPIO(209)
  136. #define DB8540_PIN_C7 _GPIO(210)
  137. #define DB8540_PIN_B8 _GPIO(211)
  138. #define DB8540_PIN_C10 _GPIO(212)
  139. #define DB8540_PIN_C8 _GPIO(213)
  140. #define DB8540_PIN_C9 _GPIO(214)
  141. /* Hole */
  142. #define DB8540_PIN_B9 _GPIO(219)
  143. #define DB8540_PIN_A10 _GPIO(220)
  144. #define DB8540_PIN_D9 _GPIO(221)
  145. #define DB8540_PIN_B11 _GPIO(222)
  146. #define DB8540_PIN_B10 _GPIO(223)
  147. #define DB8540_PIN_E10 _GPIO(224)
  148. #define DB8540_PIN_B12 _GPIO(225)
  149. #define DB8540_PIN_D10 _GPIO(226)
  150. #define DB8540_PIN_D11 _GPIO(227)
  151. #define DB8540_PIN_AJ6 _GPIO(228)
  152. #define DB8540_PIN_B13 _GPIO(229)
  153. #define DB8540_PIN_C12 _GPIO(230)
  154. #define DB8540_PIN_B14 _GPIO(231)
  155. #define DB8540_PIN_E11 _GPIO(232)
  156. /* Hole */
  157. #define DB8540_PIN_D12 _GPIO(256)
  158. #define DB8540_PIN_D15 _GPIO(257)
  159. #define DB8540_PIN_C13 _GPIO(258)
  160. #define DB8540_PIN_C14 _GPIO(259)
  161. #define DB8540_PIN_C18 _GPIO(260)
  162. #define DB8540_PIN_C16 _GPIO(261)
  163. #define DB8540_PIN_B16 _GPIO(262)
  164. #define DB8540_PIN_D18 _GPIO(263)
  165. #define DB8540_PIN_C15 _GPIO(264)
  166. #define DB8540_PIN_C17 _GPIO(265)
  167. #define DB8540_PIN_B17 _GPIO(266)
  168. #define DB8540_PIN_D17 _GPIO(267)
  169. /*
  170. * The names of the pins are denoted by GPIO number and ball name, even
  171. * though they can be used for other things than GPIO, this is the first
  172. * column in the table of the data sheet and often used on schematics and
  173. * such.
  174. */
  175. static const struct pinctrl_pin_desc nmk_db8540_pins[] = {
  176. PINCTRL_PIN(DB8540_PIN_AH6, "GPIO0_AH6"),
  177. PINCTRL_PIN(DB8540_PIN_AG7, "GPIO1_AG7"),
  178. PINCTRL_PIN(DB8540_PIN_AF2, "GPIO2_AF2"),
  179. PINCTRL_PIN(DB8540_PIN_AD3, "GPIO3_AD3"),
  180. PINCTRL_PIN(DB8540_PIN_AF6, "GPIO4_AF6"),
  181. PINCTRL_PIN(DB8540_PIN_AG6, "GPIO5_AG6"),
  182. PINCTRL_PIN(DB8540_PIN_AD5, "GPIO6_AD5"),
  183. PINCTRL_PIN(DB8540_PIN_AF7, "GPIO7_AF7"),
  184. PINCTRL_PIN(DB8540_PIN_AG5, "GPIO8_AG5"),
  185. PINCTRL_PIN(DB8540_PIN_AH5, "GPIO9_AH5"),
  186. PINCTRL_PIN(DB8540_PIN_AE4, "GPIO10_AE4"),
  187. PINCTRL_PIN(DB8540_PIN_AD1, "GPIO11_AD1"),
  188. PINCTRL_PIN(DB8540_PIN_AD2, "GPIO12_AD2"),
  189. PINCTRL_PIN(DB8540_PIN_AC2, "GPIO13_AC2"),
  190. PINCTRL_PIN(DB8540_PIN_AC4, "GPIO14_AC4"),
  191. PINCTRL_PIN(DB8540_PIN_AC3, "GPIO15_AC3"),
  192. PINCTRL_PIN(DB8540_PIN_AH7, "GPIO16_AH7"),
  193. PINCTRL_PIN(DB8540_PIN_AE7, "GPIO17_AE7"),
  194. /* Hole */
  195. PINCTRL_PIN(DB8540_PIN_AF8, "GPIO22_AF8"),
  196. PINCTRL_PIN(DB8540_PIN_AH11, "GPIO23_AH11"),
  197. PINCTRL_PIN(DB8540_PIN_AG11, "GPIO24_AG11"),
  198. PINCTRL_PIN(DB8540_PIN_AF11, "GPIO25_AF11"),
  199. PINCTRL_PIN(DB8540_PIN_AH10, "GPIO26_AH10"),
  200. PINCTRL_PIN(DB8540_PIN_AG10, "GPIO27_AG10"),
  201. PINCTRL_PIN(DB8540_PIN_AF10, "GPIO28_AF10"),
  202. /* Hole */
  203. PINCTRL_PIN(DB8540_PIN_AD4, "GPIO33_AD4"),
  204. PINCTRL_PIN(DB8540_PIN_AF3, "GPIO34_AF3"),
  205. PINCTRL_PIN(DB8540_PIN_AF5, "GPIO35_AF5"),
  206. PINCTRL_PIN(DB8540_PIN_AG4, "GPIO36_AG4"),
  207. PINCTRL_PIN(DB8540_PIN_AF9, "GPIO37_AF9"),
  208. PINCTRL_PIN(DB8540_PIN_AE8, "GPIO38_AE8"),
  209. /* Hole */
  210. PINCTRL_PIN(DB8540_PIN_M26, "GPIO64_M26"),
  211. PINCTRL_PIN(DB8540_PIN_M25, "GPIO65_M25"),
  212. PINCTRL_PIN(DB8540_PIN_M27, "GPIO66_M27"),
  213. PINCTRL_PIN(DB8540_PIN_N25, "GPIO67_N25"),
  214. /* Hole */
  215. PINCTRL_PIN(DB8540_PIN_M28, "GPIO70_M28"),
  216. PINCTRL_PIN(DB8540_PIN_N26, "GPIO71_N26"),
  217. PINCTRL_PIN(DB8540_PIN_M22, "GPIO72_M22"),
  218. PINCTRL_PIN(DB8540_PIN_N22, "GPIO73_N22"),
  219. PINCTRL_PIN(DB8540_PIN_N27, "GPIO74_N27"),
  220. PINCTRL_PIN(DB8540_PIN_N28, "GPIO75_N28"),
  221. PINCTRL_PIN(DB8540_PIN_P22, "GPIO76_P22"),
  222. PINCTRL_PIN(DB8540_PIN_P28, "GPIO77_P28"),
  223. PINCTRL_PIN(DB8540_PIN_P26, "GPIO78_P26"),
  224. PINCTRL_PIN(DB8540_PIN_T22, "GPIO79_T22"),
  225. PINCTRL_PIN(DB8540_PIN_R27, "GPIO80_R27"),
  226. PINCTRL_PIN(DB8540_PIN_P27, "GPIO81_P27"),
  227. PINCTRL_PIN(DB8540_PIN_R26, "GPIO82_R26"),
  228. PINCTRL_PIN(DB8540_PIN_R25, "GPIO83_R25"),
  229. PINCTRL_PIN(DB8540_PIN_U22, "GPIO84_U22"),
  230. PINCTRL_PIN(DB8540_PIN_T27, "GPIO85_T27"),
  231. PINCTRL_PIN(DB8540_PIN_T25, "GPIO86_T25"),
  232. PINCTRL_PIN(DB8540_PIN_T26, "GPIO87_T26"),
  233. /* Hole */
  234. PINCTRL_PIN(DB8540_PIN_AF20, "GPIO116_AF20"),
  235. PINCTRL_PIN(DB8540_PIN_AG21, "GPIO117_AG21"),
  236. PINCTRL_PIN(DB8540_PIN_AH19, "GPIO118_AH19"),
  237. PINCTRL_PIN(DB8540_PIN_AE19, "GPIO119_AE19"),
  238. PINCTRL_PIN(DB8540_PIN_AG18, "GPIO120_AG18"),
  239. PINCTRL_PIN(DB8540_PIN_AH17, "GPIO121_AH17"),
  240. PINCTRL_PIN(DB8540_PIN_AF19, "GPIO122_AF19"),
  241. PINCTRL_PIN(DB8540_PIN_AF18, "GPIO123_AF18"),
  242. PINCTRL_PIN(DB8540_PIN_AE18, "GPIO124_AE18"),
  243. PINCTRL_PIN(DB8540_PIN_AG17, "GPIO125_AG17"),
  244. PINCTRL_PIN(DB8540_PIN_AF17, "GPIO126_AF17"),
  245. PINCTRL_PIN(DB8540_PIN_AE17, "GPIO127_AE17"),
  246. PINCTRL_PIN(DB8540_PIN_AC27, "GPIO128_AC27"),
  247. PINCTRL_PIN(DB8540_PIN_AD27, "GPIO129_AD27"),
  248. PINCTRL_PIN(DB8540_PIN_AE28, "GPIO130_AE28"),
  249. PINCTRL_PIN(DB8540_PIN_AG26, "GPIO131_AG26"),
  250. PINCTRL_PIN(DB8540_PIN_AF25, "GPIO132_AF25"),
  251. PINCTRL_PIN(DB8540_PIN_AE27, "GPIO133_AE27"),
  252. PINCTRL_PIN(DB8540_PIN_AF27, "GPIO134_AF27"),
  253. PINCTRL_PIN(DB8540_PIN_AG28, "GPIO135_AG28"),
  254. PINCTRL_PIN(DB8540_PIN_AF28, "GPIO136_AF28"),
  255. PINCTRL_PIN(DB8540_PIN_AG25, "GPIO137_AG25"),
  256. PINCTRL_PIN(DB8540_PIN_AG24, "GPIO138_AG24"),
  257. PINCTRL_PIN(DB8540_PIN_AD25, "GPIO139_AD25"),
  258. PINCTRL_PIN(DB8540_PIN_AH25, "GPIO140_AH25"),
  259. PINCTRL_PIN(DB8540_PIN_AF26, "GPIO141_AF26"),
  260. PINCTRL_PIN(DB8540_PIN_AF23, "GPIO142_AF23"),
  261. PINCTRL_PIN(DB8540_PIN_AG23, "GPIO143_AG23"),
  262. PINCTRL_PIN(DB8540_PIN_AE25, "GPIO144_AE25"),
  263. PINCTRL_PIN(DB8540_PIN_AH24, "GPIO145_AH24"),
  264. PINCTRL_PIN(DB8540_PIN_AJ25, "GPIO146_AJ25"),
  265. PINCTRL_PIN(DB8540_PIN_AG27, "GPIO147_AG27"),
  266. PINCTRL_PIN(DB8540_PIN_AH23, "GPIO148_AH23"),
  267. PINCTRL_PIN(DB8540_PIN_AE26, "GPIO149_AE26"),
  268. PINCTRL_PIN(DB8540_PIN_AE24, "GPIO150_AE24"),
  269. PINCTRL_PIN(DB8540_PIN_AJ24, "GPIO151_AJ24"),
  270. PINCTRL_PIN(DB8540_PIN_AE21, "GPIO152_AE21"),
  271. PINCTRL_PIN(DB8540_PIN_AG22, "GPIO153_AG22"),
  272. PINCTRL_PIN(DB8540_PIN_AF21, "GPIO154_AF21"),
  273. PINCTRL_PIN(DB8540_PIN_AF24, "GPIO155_AF24"),
  274. PINCTRL_PIN(DB8540_PIN_AH22, "GPIO156_AH22"),
  275. PINCTRL_PIN(DB8540_PIN_AJ23, "GPIO157_AJ23"),
  276. PINCTRL_PIN(DB8540_PIN_AH21, "GPIO158_AH21"),
  277. PINCTRL_PIN(DB8540_PIN_AG20, "GPIO159_AG20"),
  278. PINCTRL_PIN(DB8540_PIN_AE23, "GPIO160_AE23"),
  279. PINCTRL_PIN(DB8540_PIN_AH20, "GPIO161_AH20"),
  280. PINCTRL_PIN(DB8540_PIN_AG19, "GPIO162_AG19"),
  281. PINCTRL_PIN(DB8540_PIN_AF22, "GPIO163_AF22"),
  282. PINCTRL_PIN(DB8540_PIN_AJ21, "GPIO164_AJ21"),
  283. PINCTRL_PIN(DB8540_PIN_AD26, "GPIO165_AD26"),
  284. PINCTRL_PIN(DB8540_PIN_AD28, "GPIO166_AD28"),
  285. PINCTRL_PIN(DB8540_PIN_AC28, "GPIO167_AC28"),
  286. PINCTRL_PIN(DB8540_PIN_AC26, "GPIO168_AC26"),
  287. /* Hole */
  288. PINCTRL_PIN(DB8540_PIN_J3, "GPIO192_J3"),
  289. PINCTRL_PIN(DB8540_PIN_H1, "GPIO193_H1"),
  290. PINCTRL_PIN(DB8540_PIN_J2, "GPIO194_J2"),
  291. PINCTRL_PIN(DB8540_PIN_H2, "GPIO195_H2"),
  292. PINCTRL_PIN(DB8540_PIN_H3, "GPIO196_H3"),
  293. PINCTRL_PIN(DB8540_PIN_H4, "GPIO197_H4"),
  294. PINCTRL_PIN(DB8540_PIN_G2, "GPIO198_G2"),
  295. PINCTRL_PIN(DB8540_PIN_G3, "GPIO199_G3"),
  296. PINCTRL_PIN(DB8540_PIN_G4, "GPIO200_G4"),
  297. PINCTRL_PIN(DB8540_PIN_F2, "GPIO201_F2"),
  298. PINCTRL_PIN(DB8540_PIN_C6, "GPIO202_C6"),
  299. PINCTRL_PIN(DB8540_PIN_B6, "GPIO203_B6"),
  300. PINCTRL_PIN(DB8540_PIN_B7, "GPIO204_B7"),
  301. PINCTRL_PIN(DB8540_PIN_A7, "GPIO205_A7"),
  302. PINCTRL_PIN(DB8540_PIN_D7, "GPIO206_D7"),
  303. PINCTRL_PIN(DB8540_PIN_D8, "GPIO207_D8"),
  304. PINCTRL_PIN(DB8540_PIN_F3, "GPIO208_F3"),
  305. PINCTRL_PIN(DB8540_PIN_E2, "GPIO209_E2"),
  306. PINCTRL_PIN(DB8540_PIN_C7, "GPIO210_C7"),
  307. PINCTRL_PIN(DB8540_PIN_B8, "GPIO211_B8"),
  308. PINCTRL_PIN(DB8540_PIN_C10, "GPIO212_C10"),
  309. PINCTRL_PIN(DB8540_PIN_C8, "GPIO213_C8"),
  310. PINCTRL_PIN(DB8540_PIN_C9, "GPIO214_C9"),
  311. /* Hole */
  312. PINCTRL_PIN(DB8540_PIN_B9, "GPIO219_B9"),
  313. PINCTRL_PIN(DB8540_PIN_A10, "GPIO220_A10"),
  314. PINCTRL_PIN(DB8540_PIN_D9, "GPIO221_D9"),
  315. PINCTRL_PIN(DB8540_PIN_B11, "GPIO222_B11"),
  316. PINCTRL_PIN(DB8540_PIN_B10, "GPIO223_B10"),
  317. PINCTRL_PIN(DB8540_PIN_E10, "GPIO224_E10"),
  318. PINCTRL_PIN(DB8540_PIN_B12, "GPIO225_B12"),
  319. PINCTRL_PIN(DB8540_PIN_D10, "GPIO226_D10"),
  320. PINCTRL_PIN(DB8540_PIN_D11, "GPIO227_D11"),
  321. PINCTRL_PIN(DB8540_PIN_AJ6, "GPIO228_AJ6"),
  322. PINCTRL_PIN(DB8540_PIN_B13, "GPIO229_B13"),
  323. PINCTRL_PIN(DB8540_PIN_C12, "GPIO230_C12"),
  324. PINCTRL_PIN(DB8540_PIN_B14, "GPIO231_B14"),
  325. PINCTRL_PIN(DB8540_PIN_E11, "GPIO232_E11"),
  326. /* Hole */
  327. PINCTRL_PIN(DB8540_PIN_D12, "GPIO256_D12"),
  328. PINCTRL_PIN(DB8540_PIN_D15, "GPIO257_D15"),
  329. PINCTRL_PIN(DB8540_PIN_C13, "GPIO258_C13"),
  330. PINCTRL_PIN(DB8540_PIN_C14, "GPIO259_C14"),
  331. PINCTRL_PIN(DB8540_PIN_C18, "GPIO260_C18"),
  332. PINCTRL_PIN(DB8540_PIN_C16, "GPIO261_C16"),
  333. PINCTRL_PIN(DB8540_PIN_B16, "GPIO262_B16"),
  334. PINCTRL_PIN(DB8540_PIN_D18, "GPIO263_D18"),
  335. PINCTRL_PIN(DB8540_PIN_C15, "GPIO264_C15"),
  336. PINCTRL_PIN(DB8540_PIN_C17, "GPIO265_C17"),
  337. PINCTRL_PIN(DB8540_PIN_B17, "GPIO266_B17"),
  338. PINCTRL_PIN(DB8540_PIN_D17, "GPIO267_D17"),
  339. };
  340. /*
  341. * Read the pin group names like this:
  342. * u0_a_1 = first groups of pins for uart0 on alt function a
  343. * i2c2_b_2 = second group of pins for i2c2 on alt function b
  344. *
  345. * The groups are arranged as sets per altfunction column, so we can
  346. * mux in one group at a time by selecting the same altfunction for them
  347. * all. When functions require pins on different altfunctions, you need
  348. * to combine several groups.
  349. */
  350. /* Altfunction A column */
  351. static const unsigned u0_a_1_pins[] = { DB8540_PIN_AH6, DB8540_PIN_AG7,
  352. DB8540_PIN_AF2, DB8540_PIN_AD3 };
  353. static const unsigned u1rxtx_a_1_pins[] = { DB8540_PIN_AF6, DB8540_PIN_AG6 };
  354. static const unsigned u1ctsrts_a_1_pins[] = { DB8540_PIN_AD5, DB8540_PIN_AF7 };
  355. /* Image processor I2C line, this is driven by image processor firmware */
  356. static const unsigned ipi2c_a_1_pins[] = { DB8540_PIN_AG5, DB8540_PIN_AH5 };
  357. static const unsigned ipi2c_a_2_pins[] = { DB8540_PIN_AE4, DB8540_PIN_AD1 };
  358. /* MSP0 can only be on these pins, but TXD and RXD can be flipped */
  359. static const unsigned msp0txrx_a_1_pins[] = { DB8540_PIN_AD2, DB8540_PIN_AC3 };
  360. static const unsigned msp0tfstck_a_1_pins[] = { DB8540_PIN_AC2,
  361. DB8540_PIN_AC4 };
  362. static const unsigned msp0rfsrck_a_1_pins[] = { DB8540_PIN_AH7,
  363. DB8540_PIN_AE7 };
  364. /* Basic pins of the MMC/SD card 0 interface */
  365. static const unsigned mc0_a_1_pins[] = { DB8540_PIN_AH11, DB8540_PIN_AG11,
  366. DB8540_PIN_AF11, DB8540_PIN_AH10, DB8540_PIN_AG10, DB8540_PIN_AF10};
  367. /* MSP1 can only be on these pins, but TXD and RXD can be flipped */
  368. static const unsigned msp1txrx_a_1_pins[] = { DB8540_PIN_AD4, DB8540_PIN_AG4 };
  369. static const unsigned msp1_a_1_pins[] = { DB8540_PIN_AF3, DB8540_PIN_AF5 };
  370. static const unsigned modobsclk_a_1_pins[] = { DB8540_PIN_AF9 };
  371. static const unsigned clkoutreq_a_1_pins[] = { DB8540_PIN_AE8 };
  372. /* LCD interface */
  373. static const unsigned lcdb_a_1_pins[] = { DB8540_PIN_M26, DB8540_PIN_M25,
  374. DB8540_PIN_M27, DB8540_PIN_N25 };
  375. static const unsigned lcdvsi0_a_1_pins[] = { DB8540_PIN_AJ24 };
  376. static const unsigned lcdvsi1_a_1_pins[] = { DB8540_PIN_AE21 };
  377. static const unsigned lcd_d0_d7_a_1_pins[] = { DB8540_PIN_M28, DB8540_PIN_N26,
  378. DB8540_PIN_M22, DB8540_PIN_N22, DB8540_PIN_N27, DB8540_PIN_N28,
  379. DB8540_PIN_P22, DB8540_PIN_P28 };
  380. /* D8 thru D11 often used as TVOUT lines */
  381. static const unsigned lcd_d8_d11_a_1_pins[] = { DB8540_PIN_P26, DB8540_PIN_T22,
  382. DB8540_PIN_R27, DB8540_PIN_P27 };
  383. static const unsigned lcd_d12_d23_a_1_pins[] = { DB8540_PIN_R26, DB8540_PIN_R25,
  384. DB8540_PIN_U22, DB8540_PIN_T27, DB8540_PIN_AG22, DB8540_PIN_AF21,
  385. DB8540_PIN_AF24, DB8540_PIN_AH22, DB8540_PIN_AJ23, DB8540_PIN_AH21,
  386. DB8540_PIN_AG20, DB8540_PIN_AE23 };
  387. static const unsigned kp_a_1_pins[] = { DB8540_PIN_AH20, DB8540_PIN_AG19,
  388. DB8540_PIN_AF22, DB8540_PIN_AJ21, DB8540_PIN_T25, DB8540_PIN_T26 };
  389. /* MC2 has 8 data lines and no direction control, so only for (e)MMC */
  390. static const unsigned mc2_a_1_pins[] = { DB8540_PIN_AC27, DB8540_PIN_AD27,
  391. DB8540_PIN_AE28, DB8540_PIN_AG26, DB8540_PIN_AF25, DB8540_PIN_AE27,
  392. DB8540_PIN_AF27, DB8540_PIN_AG28, DB8540_PIN_AF28, DB8540_PIN_AG25,
  393. DB8540_PIN_AG24 };
  394. static const unsigned ssp1_a_1_pins[] = { DB8540_PIN_AD25, DB8540_PIN_AH25,
  395. DB8540_PIN_AF26, DB8540_PIN_AF23 };
  396. static const unsigned ssp0_a_1_pins[] = { DB8540_PIN_AG23, DB8540_PIN_AE25,
  397. DB8540_PIN_AH24, DB8540_PIN_AJ25 };
  398. static const unsigned i2c0_a_1_pins[] = { DB8540_PIN_AG27, DB8540_PIN_AH23 };
  399. /*
  400. * Image processor GPIO pins are named "ipgpio" and have their own
  401. * numberspace
  402. */
  403. static const unsigned ipgpio0_a_1_pins[] = { DB8540_PIN_AE26 };
  404. static const unsigned ipgpio1_a_1_pins[] = { DB8540_PIN_AE24 };
  405. /* modem i2s interface */
  406. static const unsigned modi2s_a_1_pins[] = { DB8540_PIN_AD26, DB8540_PIN_AD28,
  407. DB8540_PIN_AC28, DB8540_PIN_AC26 };
  408. static const unsigned spi2_a_1_pins[] = { DB8540_PIN_AF20, DB8540_PIN_AG21,
  409. DB8540_PIN_AH19, DB8540_PIN_AE19 };
  410. static const unsigned u2txrx_a_1_pins[] = { DB8540_PIN_AG18, DB8540_PIN_AH17 };
  411. static const unsigned u2ctsrts_a_1_pins[] = { DB8540_PIN_AF19,
  412. DB8540_PIN_AF18 };
  413. static const unsigned modsmb_a_1_pins[] = { DB8540_PIN_AF17, DB8540_PIN_AE17 };
  414. static const unsigned msp2sck_a_1_pins[] = { DB8540_PIN_J3 };
  415. static const unsigned msp2txdtcktfs_a_1_pins[] = { DB8540_PIN_H1, DB8540_PIN_J2,
  416. DB8540_PIN_H2 };
  417. static const unsigned msp2rxd_a_1_pins[] = { DB8540_PIN_H3 };
  418. static const unsigned mc4_a_1_pins[] = { DB8540_PIN_H4, DB8540_PIN_G2,
  419. DB8540_PIN_G3, DB8540_PIN_G4, DB8540_PIN_F2, DB8540_PIN_C6,
  420. DB8540_PIN_B6, DB8540_PIN_B7, DB8540_PIN_A7, DB8540_PIN_D7,
  421. DB8540_PIN_D8 };
  422. static const unsigned mc1_a_1_pins[] = { DB8540_PIN_F3, DB8540_PIN_E2,
  423. DB8540_PIN_C7, DB8540_PIN_B8, DB8540_PIN_C10, DB8540_PIN_C8,
  424. DB8540_PIN_C9 };
  425. /* mc1_a_2_pins exclude MC1_FBCLK */
  426. static const unsigned mc1_a_2_pins[] = { DB8540_PIN_F3, DB8540_PIN_C7,
  427. DB8540_PIN_B8, DB8540_PIN_C10, DB8540_PIN_C8,
  428. DB8540_PIN_C9 };
  429. static const unsigned hsir_a_1_pins[] = { DB8540_PIN_B9, DB8540_PIN_A10,
  430. DB8540_PIN_D9 };
  431. static const unsigned hsit_a_1_pins[] = { DB8540_PIN_B11, DB8540_PIN_B10,
  432. DB8540_PIN_E10, DB8540_PIN_B12, DB8540_PIN_D10 };
  433. static const unsigned hsit_a_2_pins[] = { DB8540_PIN_B11, DB8540_PIN_B10,
  434. DB8540_PIN_E10, DB8540_PIN_B12 };
  435. static const unsigned clkout1_a_1_pins[] = { DB8540_PIN_D11 };
  436. static const unsigned clkout1_a_2_pins[] = { DB8540_PIN_B13 };
  437. static const unsigned clkout2_a_1_pins[] = { DB8540_PIN_AJ6 };
  438. static const unsigned clkout2_a_2_pins[] = { DB8540_PIN_C12 };
  439. static const unsigned msp4_a_1_pins[] = { DB8540_PIN_B14, DB8540_PIN_E11 };
  440. static const unsigned usb_a_1_pins[] = { DB8540_PIN_D12, DB8540_PIN_D15,
  441. DB8540_PIN_C13, DB8540_PIN_C14, DB8540_PIN_C18, DB8540_PIN_C16,
  442. DB8540_PIN_B16, DB8540_PIN_D18, DB8540_PIN_C15, DB8540_PIN_C17,
  443. DB8540_PIN_B17, DB8540_PIN_D17 };
  444. /* Altfunction B colum */
  445. static const unsigned apetrig_b_1_pins[] = { DB8540_PIN_AH6, DB8540_PIN_AG7 };
  446. static const unsigned modtrig_b_1_pins[] = { DB8540_PIN_AF2, DB8540_PIN_AD3 };
  447. static const unsigned i2c4_b_1_pins[] = { DB8540_PIN_AF6, DB8540_PIN_AG6 };
  448. static const unsigned i2c1_b_1_pins[] = { DB8540_PIN_AD5, DB8540_PIN_AF7 };
  449. static const unsigned i2c2_b_1_pins[] = { DB8540_PIN_AG5, DB8540_PIN_AH5 };
  450. static const unsigned i2c2_b_2_pins[] = { DB8540_PIN_AE4, DB8540_PIN_AD1 };
  451. static const unsigned msp0txrx_b_1_pins[] = { DB8540_PIN_AD2, DB8540_PIN_AC3 };
  452. static const unsigned i2c1_b_2_pins[] = { DB8540_PIN_AH7, DB8540_PIN_AE7 };
  453. static const unsigned stmmod_b_1_pins[] = { DB8540_PIN_AH11, DB8540_PIN_AF11,
  454. DB8540_PIN_AH10, DB8540_PIN_AG10, DB8540_PIN_AF10 };
  455. static const unsigned moduartstmmux_b_1_pins[] = { DB8540_PIN_AG11 };
  456. static const unsigned msp1txrx_b_1_pins[] = { DB8540_PIN_AD4, DB8540_PIN_AG4 };
  457. static const unsigned kp_b_1_pins[] = { DB8540_PIN_AJ24, DB8540_PIN_AE21,
  458. DB8540_PIN_M26, DB8540_PIN_M25, DB8540_PIN_M27, DB8540_PIN_N25,
  459. DB8540_PIN_M28, DB8540_PIN_N26, DB8540_PIN_M22, DB8540_PIN_N22,
  460. DB8540_PIN_N27, DB8540_PIN_N28, DB8540_PIN_P22, DB8540_PIN_P28,
  461. DB8540_PIN_P26, DB8540_PIN_T22, DB8540_PIN_R27, DB8540_PIN_P27,
  462. DB8540_PIN_R26, DB8540_PIN_R25 };
  463. static const unsigned u2txrx_b_1_pins[] = { DB8540_PIN_U22, DB8540_PIN_T27 };
  464. static const unsigned sm_b_1_pins[] = { DB8540_PIN_AG22, DB8540_PIN_AF21,
  465. DB8540_PIN_AF24, DB8540_PIN_AH22, DB8540_PIN_AJ23, DB8540_PIN_AH21,
  466. DB8540_PIN_AG20, DB8540_PIN_AE23, DB8540_PIN_AH20, DB8540_PIN_AF22,
  467. DB8540_PIN_AJ21, DB8540_PIN_AC27, DB8540_PIN_AD27, DB8540_PIN_AE28,
  468. DB8540_PIN_AG26, DB8540_PIN_AF25, DB8540_PIN_AE27, DB8540_PIN_AF27,
  469. DB8540_PIN_AG28, DB8540_PIN_AF28, DB8540_PIN_AG25, DB8540_PIN_AG24,
  470. DB8540_PIN_AD25 };
  471. static const unsigned smcs0_b_1_pins[] = { DB8540_PIN_AG19 };
  472. static const unsigned smcs1_b_1_pins[] = { DB8540_PIN_AE26 };
  473. static const unsigned ipgpio7_b_1_pins[] = { DB8540_PIN_AH25 };
  474. static const unsigned ipgpio2_b_1_pins[] = { DB8540_PIN_AF26 };
  475. static const unsigned ipgpio3_b_1_pins[] = { DB8540_PIN_AF23 };
  476. static const unsigned i2c6_b_1_pins[] = { DB8540_PIN_AG23, DB8540_PIN_AE25 };
  477. static const unsigned i2c5_b_1_pins[] = { DB8540_PIN_AH24, DB8540_PIN_AJ25 };
  478. static const unsigned u3txrx_b_1_pins[] = { DB8540_PIN_AF20, DB8540_PIN_AG21 };
  479. static const unsigned u3ctsrts_b_1_pins[] = { DB8540_PIN_AH19,
  480. DB8540_PIN_AE19 };
  481. static const unsigned i2c5_b_2_pins[] = { DB8540_PIN_AG18, DB8540_PIN_AH17 };
  482. static const unsigned i2c4_b_2_pins[] = { DB8540_PIN_AF19, DB8540_PIN_AF18 };
  483. static const unsigned u4txrx_b_1_pins[] = { DB8540_PIN_AE18, DB8540_PIN_AG17 };
  484. static const unsigned u4ctsrts_b_1_pins[] = { DB8540_PIN_AF17,
  485. DB8540_PIN_AE17 };
  486. static const unsigned ddrtrig_b_1_pins[] = { DB8540_PIN_J3 };
  487. static const unsigned msp4_b_1_pins[] = { DB8540_PIN_H3 };
  488. static const unsigned pwl_b_1_pins[] = { DB8540_PIN_C6 };
  489. static const unsigned spi1_b_1_pins[] = { DB8540_PIN_E2, DB8540_PIN_C10,
  490. DB8540_PIN_C8, DB8540_PIN_C9 };
  491. static const unsigned mc3_b_1_pins[] = { DB8540_PIN_B9, DB8540_PIN_A10,
  492. DB8540_PIN_D9, DB8540_PIN_B11, DB8540_PIN_B10, DB8540_PIN_E10,
  493. DB8540_PIN_B12 };
  494. static const unsigned pwl_b_2_pins[] = { DB8540_PIN_D10 };
  495. static const unsigned pwl_b_3_pins[] = { DB8540_PIN_B13 };
  496. static const unsigned pwl_b_4_pins[] = { DB8540_PIN_C12 };
  497. static const unsigned u2txrx_b_2_pins[] = { DB8540_PIN_B17, DB8540_PIN_D17 };
  498. /* Altfunction C column */
  499. static const unsigned ipgpio6_c_1_pins[] = { DB8540_PIN_AG6 };
  500. static const unsigned ipgpio0_c_1_pins[] = { DB8540_PIN_AD5 };
  501. static const unsigned ipgpio1_c_1_pins[] = { DB8540_PIN_AF7 };
  502. static const unsigned ipgpio3_c_1_pins[] = { DB8540_PIN_AE4 };
  503. static const unsigned ipgpio2_c_1_pins[] = { DB8540_PIN_AD1 };
  504. static const unsigned u0_c_1_pins[] = { DB8540_PIN_AD4, DB8540_PIN_AF3,
  505. DB8540_PIN_AF5, DB8540_PIN_AG4 };
  506. static const unsigned smcleale_c_1_pins[] = { DB8540_PIN_AJ24,
  507. DB8540_PIN_AE21 };
  508. static const unsigned ipgpio4_c_1_pins[] = { DB8540_PIN_M26 };
  509. static const unsigned ipgpio5_c_1_pins[] = { DB8540_PIN_M25 };
  510. static const unsigned ipgpio6_c_2_pins[] = { DB8540_PIN_M27 };
  511. static const unsigned ipgpio7_c_1_pins[] = { DB8540_PIN_N25 };
  512. static const unsigned stmape_c_1_pins[] = { DB8540_PIN_M28, DB8540_PIN_N26,
  513. DB8540_PIN_M22, DB8540_PIN_N22, DB8540_PIN_N27 };
  514. static const unsigned u2rxtx_c_1_pins[] = { DB8540_PIN_N28, DB8540_PIN_P22 };
  515. static const unsigned modobsresout_c_1_pins[] = { DB8540_PIN_P28 };
  516. static const unsigned ipgpio2_c_2_pins[] = { DB8540_PIN_P26 };
  517. static const unsigned ipgpio3_c_2_pins[] = { DB8540_PIN_T22 };
  518. static const unsigned ipgpio4_c_2_pins[] = { DB8540_PIN_R27 };
  519. static const unsigned ipgpio5_c_2_pins[] = { DB8540_PIN_P27 };
  520. static const unsigned modaccgpo_c_1_pins[] = { DB8540_PIN_R26, DB8540_PIN_R25,
  521. DB8540_PIN_U22 };
  522. static const unsigned modobspwrrst_c_1_pins[] = { DB8540_PIN_T27 };
  523. static const unsigned mc5_c_1_pins[] = { DB8540_PIN_AG22, DB8540_PIN_AF21,
  524. DB8540_PIN_AF24, DB8540_PIN_AH22, DB8540_PIN_AJ23, DB8540_PIN_AH21,
  525. DB8540_PIN_AG20, DB8540_PIN_AE23, DB8540_PIN_AH20, DB8540_PIN_AF22,
  526. DB8540_PIN_AJ21};
  527. static const unsigned smps0_c_1_pins[] = { DB8540_PIN_AG19 };
  528. static const unsigned moduart1_c_1_pins[] = { DB8540_PIN_T25, DB8540_PIN_T26 };
  529. static const unsigned mc2rstn_c_1_pins[] = { DB8540_PIN_AE28 };
  530. static const unsigned i2c5_c_1_pins[] = { DB8540_PIN_AG28, DB8540_PIN_AF28 };
  531. static const unsigned ipgpio0_c_2_pins[] = { DB8540_PIN_AG25 };
  532. static const unsigned ipgpio1_c_2_pins[] = { DB8540_PIN_AG24 };
  533. static const unsigned kp_c_1_pins[] = { DB8540_PIN_AD25, DB8540_PIN_AH25,
  534. DB8540_PIN_AF26, DB8540_PIN_AF23 };
  535. static const unsigned modrf_c_1_pins[] = { DB8540_PIN_AG23, DB8540_PIN_AE25,
  536. DB8540_PIN_AH24 };
  537. static const unsigned smps1_c_1_pins[] = { DB8540_PIN_AE26 };
  538. static const unsigned i2c5_c_2_pins[] = { DB8540_PIN_AH19, DB8540_PIN_AE19 };
  539. static const unsigned u4ctsrts_c_1_pins[] = { DB8540_PIN_AG18,
  540. DB8540_PIN_AH17 };
  541. static const unsigned u3rxtx_c_1_pins[] = { DB8540_PIN_AF19, DB8540_PIN_AF18 };
  542. static const unsigned msp4_c_1_pins[] = { DB8540_PIN_J3 };
  543. static const unsigned mc4rstn_c_1_pins[] = { DB8540_PIN_C6 };
  544. static const unsigned spi0_c_1_pins[] = { DB8540_PIN_A10, DB8540_PIN_B10,
  545. DB8540_PIN_E10, DB8540_PIN_B12 };
  546. static const unsigned i2c3_c_1_pins[] = { DB8540_PIN_B13, DB8540_PIN_C12 };
  547. /* Other alt C1 column */
  548. static const unsigned spi3_oc1_1_pins[] = { DB8540_PIN_AG5, DB8540_PIN_AH5,
  549. DB8540_PIN_AE4, DB8540_PIN_AD1 };
  550. static const unsigned stmape_oc1_1_pins[] = { DB8540_PIN_AH11, DB8540_PIN_AF11,
  551. DB8540_PIN_AH10, DB8540_PIN_AG10, DB8540_PIN_AF10 };
  552. static const unsigned u2_oc1_1_pins[] = { DB8540_PIN_AG11 };
  553. static const unsigned remap0_oc1_1_pins[] = { DB8540_PIN_AJ24 };
  554. static const unsigned remap1_oc1_1_pins[] = { DB8540_PIN_AE21 };
  555. static const unsigned modobsrefclk_oc1_1_pins[] = { DB8540_PIN_M26 };
  556. static const unsigned modobspwrctrl_oc1_1_pins[] = { DB8540_PIN_M25 };
  557. static const unsigned modobsclkout_oc1_1_pins[] = { DB8540_PIN_M27 };
  558. static const unsigned moduart1_oc1_1_pins[] = { DB8540_PIN_N25 };
  559. static const unsigned modprcmudbg_oc1_1_pins[] = { DB8540_PIN_M28,
  560. DB8540_PIN_N26, DB8540_PIN_M22, DB8540_PIN_N22, DB8540_PIN_N27,
  561. DB8540_PIN_P22, DB8540_PIN_P28, DB8540_PIN_P26, DB8540_PIN_T22,
  562. DB8540_PIN_R26, DB8540_PIN_R25, DB8540_PIN_U22, DB8540_PIN_T27,
  563. DB8540_PIN_AH20, DB8540_PIN_AG19, DB8540_PIN_AF22, DB8540_PIN_AJ21,
  564. DB8540_PIN_T25};
  565. static const unsigned modobsresout_oc1_1_pins[] = { DB8540_PIN_N28 };
  566. static const unsigned modaccgpo_oc1_1_pins[] = { DB8540_PIN_R27, DB8540_PIN_P27,
  567. DB8540_PIN_T26 };
  568. static const unsigned kp_oc1_1_pins[] = { DB8540_PIN_AG22, DB8540_PIN_AF21,
  569. DB8540_PIN_AF24, DB8540_PIN_AH22, DB8540_PIN_AJ23, DB8540_PIN_AH21,
  570. DB8540_PIN_AG20, DB8540_PIN_AE23 };
  571. static const unsigned modxmip_oc1_1_pins[] = { DB8540_PIN_AD25, DB8540_PIN_AH25,
  572. DB8540_PIN_AG23, DB8540_PIN_AE25 };
  573. static const unsigned i2c6_oc1_1_pins[] = { DB8540_PIN_AE26, DB8540_PIN_AE24 };
  574. static const unsigned u2txrx_oc1_1_pins[] = { DB8540_PIN_B7, DB8540_PIN_A7 };
  575. static const unsigned u2ctsrts_oc1_1_pins[] = { DB8540_PIN_D7, DB8540_PIN_D8 };
  576. /* Other alt C2 column */
  577. static const unsigned sbag_oc2_1_pins[] = { DB8540_PIN_AH11, DB8540_PIN_AG11,
  578. DB8540_PIN_AF11, DB8540_PIN_AH10, DB8540_PIN_AG10, DB8540_PIN_AF10 };
  579. static const unsigned hxclk_oc2_1_pins[] = { DB8540_PIN_M25 };
  580. static const unsigned modaccuart_oc2_1_pins[] = { DB8540_PIN_N25 };
  581. static const unsigned stmmod_oc2_1_pins[] = { DB8540_PIN_M28, DB8540_PIN_N26,
  582. DB8540_PIN_M22, DB8540_PIN_N22, DB8540_PIN_N27 };
  583. static const unsigned moduartstmmux_oc2_1_pins[] = { DB8540_PIN_N28 };
  584. static const unsigned hxgpio_oc2_1_pins[] = { DB8540_PIN_P22, DB8540_PIN_P28,
  585. DB8540_PIN_P26, DB8540_PIN_T22, DB8540_PIN_R27, DB8540_PIN_P27,
  586. DB8540_PIN_R26, DB8540_PIN_R25 };
  587. static const unsigned sbag_oc2_2_pins[] = { DB8540_PIN_U22, DB8540_PIN_T27,
  588. DB8540_PIN_AG22, DB8540_PIN_AF21, DB8540_PIN_AF24, DB8540_PIN_AH22 };
  589. static const unsigned modobsservice_oc2_1_pins[] = { DB8540_PIN_AJ23 };
  590. static const unsigned moduart0_oc2_1_pins[] = { DB8540_PIN_AG20,
  591. DB8540_PIN_AE23 };
  592. static const unsigned stmape_oc2_1_pins[] = { DB8540_PIN_AH20, DB8540_PIN_AG19,
  593. DB8540_PIN_AF22, DB8540_PIN_AJ21, DB8540_PIN_T25 };
  594. static const unsigned u2_oc2_1_pins[] = { DB8540_PIN_T26, DB8540_PIN_AH21 };
  595. static const unsigned modxmip_oc2_1_pins[] = { DB8540_PIN_AE26,
  596. DB8540_PIN_AE24 };
  597. /* Other alt C3 column */
  598. static const unsigned modaccgpo_oc3_1_pins[] = { DB8540_PIN_AG11 };
  599. static const unsigned tpui_oc3_1_pins[] = { DB8540_PIN_M26, DB8540_PIN_M25,
  600. DB8540_PIN_M27, DB8540_PIN_N25, DB8540_PIN_M28, DB8540_PIN_N26,
  601. DB8540_PIN_M22, DB8540_PIN_N22, DB8540_PIN_N27, DB8540_PIN_N28,
  602. DB8540_PIN_P22, DB8540_PIN_P28, DB8540_PIN_P26, DB8540_PIN_T22,
  603. DB8540_PIN_R27, DB8540_PIN_P27, DB8540_PIN_R26, DB8540_PIN_R25,
  604. DB8540_PIN_U22, DB8540_PIN_T27, DB8540_PIN_AG22, DB8540_PIN_AF21,
  605. DB8540_PIN_AF24, DB8540_PIN_AH22, DB8540_PIN_AJ23, DB8540_PIN_AH21,
  606. DB8540_PIN_AG20, DB8540_PIN_AE23, DB8540_PIN_AH20, DB8540_PIN_AG19,
  607. DB8540_PIN_AF22, DB8540_PIN_AJ21, DB8540_PIN_T25, DB8540_PIN_T26 };
  608. /* Other alt C4 column */
  609. static const unsigned hwobs_oc4_1_pins[] = { DB8540_PIN_M26, DB8540_PIN_M25,
  610. DB8540_PIN_M27, DB8540_PIN_N25, DB8540_PIN_M28, DB8540_PIN_N26,
  611. DB8540_PIN_M22, DB8540_PIN_N22, DB8540_PIN_N27, DB8540_PIN_N28,
  612. DB8540_PIN_P22, DB8540_PIN_P28, DB8540_PIN_P26, DB8540_PIN_T22,
  613. DB8540_PIN_R27, DB8540_PIN_P27, DB8540_PIN_R26, DB8540_PIN_R25 };
  614. static const unsigned moduart1txrx_oc4_1_pins[] = { DB8540_PIN_U22,
  615. DB8540_PIN_T27 };
  616. static const unsigned moduart1rtscts_oc4_1_pins[] = { DB8540_PIN_AG22,
  617. DB8540_PIN_AF21 };
  618. static const unsigned modaccuarttxrx_oc4_1_pins[] = { DB8540_PIN_AF24,
  619. DB8540_PIN_AH22 };
  620. static const unsigned modaccuartrtscts_oc4_1_pins[] = { DB8540_PIN_AJ23,
  621. DB8540_PIN_AH21 };
  622. static const unsigned stmmod_oc4_1_pins[] = { DB8540_PIN_AH20, DB8540_PIN_AG19,
  623. DB8540_PIN_AF22, DB8540_PIN_AJ21, DB8540_PIN_T25 };
  624. static const unsigned moduartstmmux_oc4_1_pins[] = { DB8540_PIN_T26 };
  625. #define DB8540_PIN_GROUP(a, b) { .name = #a, .pins = a##_pins, \
  626. .npins = ARRAY_SIZE(a##_pins), .altsetting = b }
  627. static const struct nmk_pingroup nmk_db8540_groups[] = {
  628. /* Altfunction A column */
  629. DB8540_PIN_GROUP(u0_a_1, NMK_GPIO_ALT_A),
  630. DB8540_PIN_GROUP(u1rxtx_a_1, NMK_GPIO_ALT_A),
  631. DB8540_PIN_GROUP(u1ctsrts_a_1, NMK_GPIO_ALT_A),
  632. DB8540_PIN_GROUP(ipi2c_a_1, NMK_GPIO_ALT_A),
  633. DB8540_PIN_GROUP(ipi2c_a_2, NMK_GPIO_ALT_A),
  634. DB8540_PIN_GROUP(msp0txrx_a_1, NMK_GPIO_ALT_A),
  635. DB8540_PIN_GROUP(msp0tfstck_a_1, NMK_GPIO_ALT_A),
  636. DB8540_PIN_GROUP(msp0rfsrck_a_1, NMK_GPIO_ALT_A),
  637. DB8540_PIN_GROUP(mc0_a_1, NMK_GPIO_ALT_A),
  638. DB8540_PIN_GROUP(msp1txrx_a_1, NMK_GPIO_ALT_A),
  639. DB8540_PIN_GROUP(msp1_a_1, NMK_GPIO_ALT_A),
  640. DB8540_PIN_GROUP(modobsclk_a_1, NMK_GPIO_ALT_A),
  641. DB8540_PIN_GROUP(clkoutreq_a_1, NMK_GPIO_ALT_A),
  642. DB8540_PIN_GROUP(lcdb_a_1, NMK_GPIO_ALT_A),
  643. DB8540_PIN_GROUP(lcdvsi0_a_1, NMK_GPIO_ALT_A),
  644. DB8540_PIN_GROUP(lcdvsi1_a_1, NMK_GPIO_ALT_A),
  645. DB8540_PIN_GROUP(lcd_d0_d7_a_1, NMK_GPIO_ALT_A),
  646. DB8540_PIN_GROUP(lcd_d8_d11_a_1, NMK_GPIO_ALT_A),
  647. DB8540_PIN_GROUP(lcd_d12_d23_a_1, NMK_GPIO_ALT_A),
  648. DB8540_PIN_GROUP(kp_a_1, NMK_GPIO_ALT_A),
  649. DB8540_PIN_GROUP(mc2_a_1, NMK_GPIO_ALT_A),
  650. DB8540_PIN_GROUP(ssp1_a_1, NMK_GPIO_ALT_A),
  651. DB8540_PIN_GROUP(ssp0_a_1, NMK_GPIO_ALT_A),
  652. DB8540_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A),
  653. DB8540_PIN_GROUP(ipgpio0_a_1, NMK_GPIO_ALT_A),
  654. DB8540_PIN_GROUP(ipgpio1_a_1, NMK_GPIO_ALT_A),
  655. DB8540_PIN_GROUP(modi2s_a_1, NMK_GPIO_ALT_A),
  656. DB8540_PIN_GROUP(spi2_a_1, NMK_GPIO_ALT_A),
  657. DB8540_PIN_GROUP(u2txrx_a_1, NMK_GPIO_ALT_A),
  658. DB8540_PIN_GROUP(u2ctsrts_a_1, NMK_GPIO_ALT_A),
  659. DB8540_PIN_GROUP(modsmb_a_1, NMK_GPIO_ALT_A),
  660. DB8540_PIN_GROUP(msp2sck_a_1, NMK_GPIO_ALT_A),
  661. DB8540_PIN_GROUP(msp2txdtcktfs_a_1, NMK_GPIO_ALT_A),
  662. DB8540_PIN_GROUP(msp2rxd_a_1, NMK_GPIO_ALT_A),
  663. DB8540_PIN_GROUP(mc4_a_1, NMK_GPIO_ALT_A),
  664. DB8540_PIN_GROUP(mc1_a_1, NMK_GPIO_ALT_A),
  665. DB8540_PIN_GROUP(hsir_a_1, NMK_GPIO_ALT_A),
  666. DB8540_PIN_GROUP(hsit_a_1, NMK_GPIO_ALT_A),
  667. DB8540_PIN_GROUP(hsit_a_2, NMK_GPIO_ALT_A),
  668. DB8540_PIN_GROUP(clkout1_a_1, NMK_GPIO_ALT_A),
  669. DB8540_PIN_GROUP(clkout1_a_2, NMK_GPIO_ALT_A),
  670. DB8540_PIN_GROUP(clkout2_a_1, NMK_GPIO_ALT_A),
  671. DB8540_PIN_GROUP(clkout2_a_2, NMK_GPIO_ALT_A),
  672. DB8540_PIN_GROUP(msp4_a_1, NMK_GPIO_ALT_A),
  673. DB8540_PIN_GROUP(usb_a_1, NMK_GPIO_ALT_A),
  674. /* Altfunction B column */
  675. DB8540_PIN_GROUP(apetrig_b_1, NMK_GPIO_ALT_B),
  676. DB8540_PIN_GROUP(modtrig_b_1, NMK_GPIO_ALT_B),
  677. DB8540_PIN_GROUP(i2c4_b_1, NMK_GPIO_ALT_B),
  678. DB8540_PIN_GROUP(i2c1_b_1, NMK_GPIO_ALT_B),
  679. DB8540_PIN_GROUP(i2c2_b_1, NMK_GPIO_ALT_B),
  680. DB8540_PIN_GROUP(i2c2_b_2, NMK_GPIO_ALT_B),
  681. DB8540_PIN_GROUP(msp0txrx_b_1, NMK_GPIO_ALT_B),
  682. DB8540_PIN_GROUP(i2c1_b_2, NMK_GPIO_ALT_B),
  683. DB8540_PIN_GROUP(stmmod_b_1, NMK_GPIO_ALT_B),
  684. DB8540_PIN_GROUP(moduartstmmux_b_1, NMK_GPIO_ALT_B),
  685. DB8540_PIN_GROUP(msp1txrx_b_1, NMK_GPIO_ALT_B),
  686. DB8540_PIN_GROUP(kp_b_1, NMK_GPIO_ALT_B),
  687. DB8540_PIN_GROUP(u2txrx_b_1, NMK_GPIO_ALT_B),
  688. DB8540_PIN_GROUP(sm_b_1, NMK_GPIO_ALT_B),
  689. DB8540_PIN_GROUP(smcs0_b_1, NMK_GPIO_ALT_B),
  690. DB8540_PIN_GROUP(smcs1_b_1, NMK_GPIO_ALT_B),
  691. DB8540_PIN_GROUP(ipgpio7_b_1, NMK_GPIO_ALT_B),
  692. DB8540_PIN_GROUP(ipgpio2_b_1, NMK_GPIO_ALT_B),
  693. DB8540_PIN_GROUP(ipgpio3_b_1, NMK_GPIO_ALT_B),
  694. DB8540_PIN_GROUP(i2c6_b_1, NMK_GPIO_ALT_B),
  695. DB8540_PIN_GROUP(i2c5_b_1, NMK_GPIO_ALT_B),
  696. DB8540_PIN_GROUP(u3txrx_b_1, NMK_GPIO_ALT_B),
  697. DB8540_PIN_GROUP(u3ctsrts_b_1, NMK_GPIO_ALT_B),
  698. DB8540_PIN_GROUP(i2c5_b_2, NMK_GPIO_ALT_B),
  699. DB8540_PIN_GROUP(i2c4_b_2, NMK_GPIO_ALT_B),
  700. DB8540_PIN_GROUP(u4txrx_b_1, NMK_GPIO_ALT_B),
  701. DB8540_PIN_GROUP(u4ctsrts_b_1, NMK_GPIO_ALT_B),
  702. DB8540_PIN_GROUP(ddrtrig_b_1, NMK_GPIO_ALT_B),
  703. DB8540_PIN_GROUP(msp4_b_1, NMK_GPIO_ALT_B),
  704. DB8540_PIN_GROUP(pwl_b_1, NMK_GPIO_ALT_B),
  705. DB8540_PIN_GROUP(spi1_b_1, NMK_GPIO_ALT_B),
  706. DB8540_PIN_GROUP(mc3_b_1, NMK_GPIO_ALT_B),
  707. DB8540_PIN_GROUP(pwl_b_2, NMK_GPIO_ALT_B),
  708. DB8540_PIN_GROUP(pwl_b_3, NMK_GPIO_ALT_B),
  709. DB8540_PIN_GROUP(pwl_b_4, NMK_GPIO_ALT_B),
  710. DB8540_PIN_GROUP(u2txrx_b_2, NMK_GPIO_ALT_B),
  711. /* Altfunction C column */
  712. DB8540_PIN_GROUP(ipgpio6_c_1, NMK_GPIO_ALT_C),
  713. DB8540_PIN_GROUP(ipgpio0_c_1, NMK_GPIO_ALT_C),
  714. DB8540_PIN_GROUP(ipgpio1_c_1, NMK_GPIO_ALT_C),
  715. DB8540_PIN_GROUP(ipgpio3_c_1, NMK_GPIO_ALT_C),
  716. DB8540_PIN_GROUP(ipgpio2_c_1, NMK_GPIO_ALT_C),
  717. DB8540_PIN_GROUP(u0_c_1, NMK_GPIO_ALT_C),
  718. DB8540_PIN_GROUP(smcleale_c_1, NMK_GPIO_ALT_C),
  719. DB8540_PIN_GROUP(ipgpio4_c_1, NMK_GPIO_ALT_C),
  720. DB8540_PIN_GROUP(ipgpio5_c_1, NMK_GPIO_ALT_C),
  721. DB8540_PIN_GROUP(ipgpio6_c_2, NMK_GPIO_ALT_C),
  722. DB8540_PIN_GROUP(ipgpio7_c_1, NMK_GPIO_ALT_C),
  723. DB8540_PIN_GROUP(stmape_c_1, NMK_GPIO_ALT_C),
  724. DB8540_PIN_GROUP(u2rxtx_c_1, NMK_GPIO_ALT_C),
  725. DB8540_PIN_GROUP(modobsresout_c_1, NMK_GPIO_ALT_C),
  726. DB8540_PIN_GROUP(ipgpio2_c_2, NMK_GPIO_ALT_C),
  727. DB8540_PIN_GROUP(ipgpio3_c_2, NMK_GPIO_ALT_C),
  728. DB8540_PIN_GROUP(ipgpio4_c_2, NMK_GPIO_ALT_C),
  729. DB8540_PIN_GROUP(ipgpio5_c_2, NMK_GPIO_ALT_C),
  730. DB8540_PIN_GROUP(modaccgpo_c_1, NMK_GPIO_ALT_C),
  731. DB8540_PIN_GROUP(modobspwrrst_c_1, NMK_GPIO_ALT_C),
  732. DB8540_PIN_GROUP(mc5_c_1, NMK_GPIO_ALT_C),
  733. DB8540_PIN_GROUP(smps0_c_1, NMK_GPIO_ALT_C),
  734. DB8540_PIN_GROUP(moduart1_c_1, NMK_GPIO_ALT_C),
  735. DB8540_PIN_GROUP(mc2rstn_c_1, NMK_GPIO_ALT_C),
  736. DB8540_PIN_GROUP(i2c5_c_1, NMK_GPIO_ALT_C),
  737. DB8540_PIN_GROUP(ipgpio0_c_2, NMK_GPIO_ALT_C),
  738. DB8540_PIN_GROUP(ipgpio1_c_2, NMK_GPIO_ALT_C),
  739. DB8540_PIN_GROUP(kp_c_1, NMK_GPIO_ALT_C),
  740. DB8540_PIN_GROUP(modrf_c_1, NMK_GPIO_ALT_C),
  741. DB8540_PIN_GROUP(smps1_c_1, NMK_GPIO_ALT_C),
  742. DB8540_PIN_GROUP(i2c5_c_2, NMK_GPIO_ALT_C),
  743. DB8540_PIN_GROUP(u4ctsrts_c_1, NMK_GPIO_ALT_C),
  744. DB8540_PIN_GROUP(u3rxtx_c_1, NMK_GPIO_ALT_C),
  745. DB8540_PIN_GROUP(msp4_c_1, NMK_GPIO_ALT_C),
  746. DB8540_PIN_GROUP(mc4rstn_c_1, NMK_GPIO_ALT_C),
  747. DB8540_PIN_GROUP(spi0_c_1, NMK_GPIO_ALT_C),
  748. DB8540_PIN_GROUP(i2c3_c_1, NMK_GPIO_ALT_C),
  749. /* Other alt C1 column */
  750. DB8540_PIN_GROUP(spi3_oc1_1, NMK_GPIO_ALT_C1),
  751. DB8540_PIN_GROUP(stmape_oc1_1, NMK_GPIO_ALT_C1),
  752. DB8540_PIN_GROUP(u2_oc1_1, NMK_GPIO_ALT_C1),
  753. DB8540_PIN_GROUP(remap0_oc1_1, NMK_GPIO_ALT_C1),
  754. DB8540_PIN_GROUP(remap1_oc1_1, NMK_GPIO_ALT_C1),
  755. DB8540_PIN_GROUP(modobsrefclk_oc1_1, NMK_GPIO_ALT_C1),
  756. DB8540_PIN_GROUP(modobspwrctrl_oc1_1, NMK_GPIO_ALT_C1),
  757. DB8540_PIN_GROUP(modobsclkout_oc1_1, NMK_GPIO_ALT_C1),
  758. DB8540_PIN_GROUP(moduart1_oc1_1, NMK_GPIO_ALT_C1),
  759. DB8540_PIN_GROUP(modprcmudbg_oc1_1, NMK_GPIO_ALT_C1),
  760. DB8540_PIN_GROUP(modobsresout_oc1_1, NMK_GPIO_ALT_C1),
  761. DB8540_PIN_GROUP(modaccgpo_oc1_1, NMK_GPIO_ALT_C1),
  762. DB8540_PIN_GROUP(kp_oc1_1, NMK_GPIO_ALT_C1),
  763. DB8540_PIN_GROUP(modxmip_oc1_1, NMK_GPIO_ALT_C1),
  764. DB8540_PIN_GROUP(i2c6_oc1_1, NMK_GPIO_ALT_C1),
  765. DB8540_PIN_GROUP(u2txrx_oc1_1, NMK_GPIO_ALT_C1),
  766. DB8540_PIN_GROUP(u2ctsrts_oc1_1, NMK_GPIO_ALT_C1),
  767. /* Other alt C2 column */
  768. DB8540_PIN_GROUP(sbag_oc2_1, NMK_GPIO_ALT_C2),
  769. DB8540_PIN_GROUP(hxclk_oc2_1, NMK_GPIO_ALT_C2),
  770. DB8540_PIN_GROUP(modaccuart_oc2_1, NMK_GPIO_ALT_C2),
  771. DB8540_PIN_GROUP(stmmod_oc2_1, NMK_GPIO_ALT_C2),
  772. DB8540_PIN_GROUP(moduartstmmux_oc2_1, NMK_GPIO_ALT_C2),
  773. DB8540_PIN_GROUP(hxgpio_oc2_1, NMK_GPIO_ALT_C2),
  774. DB8540_PIN_GROUP(sbag_oc2_2, NMK_GPIO_ALT_C2),
  775. DB8540_PIN_GROUP(modobsservice_oc2_1, NMK_GPIO_ALT_C2),
  776. DB8540_PIN_GROUP(moduart0_oc2_1, NMK_GPIO_ALT_C2),
  777. DB8540_PIN_GROUP(stmape_oc2_1, NMK_GPIO_ALT_C2),
  778. DB8540_PIN_GROUP(u2_oc2_1, NMK_GPIO_ALT_C2),
  779. DB8540_PIN_GROUP(modxmip_oc2_1, NMK_GPIO_ALT_C2),
  780. /* Other alt C3 column */
  781. DB8540_PIN_GROUP(modaccgpo_oc3_1, NMK_GPIO_ALT_C3),
  782. DB8540_PIN_GROUP(tpui_oc3_1, NMK_GPIO_ALT_C3),
  783. /* Other alt C4 column */
  784. DB8540_PIN_GROUP(hwobs_oc4_1, NMK_GPIO_ALT_C4),
  785. DB8540_PIN_GROUP(moduart1txrx_oc4_1, NMK_GPIO_ALT_C4),
  786. DB8540_PIN_GROUP(moduart1rtscts_oc4_1, NMK_GPIO_ALT_C4),
  787. DB8540_PIN_GROUP(modaccuarttxrx_oc4_1, NMK_GPIO_ALT_C4),
  788. DB8540_PIN_GROUP(modaccuartrtscts_oc4_1, NMK_GPIO_ALT_C4),
  789. DB8540_PIN_GROUP(stmmod_oc4_1, NMK_GPIO_ALT_C4),
  790. DB8540_PIN_GROUP(moduartstmmux_oc4_1, NMK_GPIO_ALT_C4),
  791. };
  792. /* We use this macro to define the groups applicable to a function */
  793. #define DB8540_FUNC_GROUPS(a, b...) \
  794. static const char * const a##_groups[] = { b };
  795. DB8540_FUNC_GROUPS(apetrig, "apetrig_b_1");
  796. DB8540_FUNC_GROUPS(clkout, "clkoutreq_a_1", "clkout1_a_1", "clkout1_a_2",
  797. "clkout2_a_1", "clkout2_a_2");
  798. DB8540_FUNC_GROUPS(ddrtrig, "ddrtrig_b_1");
  799. DB8540_FUNC_GROUPS(hsi, "hsir_a_1", "hsit_a_1", "hsit_a_2");
  800. DB8540_FUNC_GROUPS(hwobs, "hwobs_oc4_1");
  801. DB8540_FUNC_GROUPS(hx, "hxclk_oc2_1", "hxgpio_oc2_1");
  802. DB8540_FUNC_GROUPS(i2c0, "i2c0_a_1");
  803. DB8540_FUNC_GROUPS(i2c1, "i2c1_b_1", "i2c1_b_2");
  804. DB8540_FUNC_GROUPS(i2c2, "i2c2_b_1", "i2c2_b_2");
  805. DB8540_FUNC_GROUPS(i2c3, "i2c3_c_1", "i2c4_b_1");
  806. DB8540_FUNC_GROUPS(i2c4, "i2c4_b_2");
  807. DB8540_FUNC_GROUPS(i2c5, "i2c5_b_1", "i2c5_b_2", "i2c5_c_1", "i2c5_c_2");
  808. DB8540_FUNC_GROUPS(i2c6, "i2c6_b_1", "i2c6_oc1_1");
  809. /* The image processor has 8 GPIO pins that can be muxed out */
  810. DB8540_FUNC_GROUPS(ipgpio, "ipgpio0_a_1", "ipgpio0_c_1", "ipgpio0_c_2",
  811. "ipgpio1_a_1", "ipgpio1_c_1", "ipgpio1_c_2",
  812. "ipgpio2_b_1", "ipgpio2_c_1", "ipgpio2_c_2",
  813. "ipgpio3_b_1", "ipgpio3_c_1", "ipgpio3_c_2",
  814. "ipgpio4_c_1", "ipgpio4_c_2",
  815. "ipgpio5_c_1", "ipgpio5_c_2",
  816. "ipgpio6_c_1", "ipgpio6_c_2",
  817. "ipgpio7_b_1", "ipgpio7_c_1");
  818. DB8540_FUNC_GROUPS(ipi2c, "ipi2c_a_1", "ipi2c_a_2");
  819. DB8540_FUNC_GROUPS(kp, "kp_a_1", "kp_b_1", "kp_c_1", "kp_oc1_1");
  820. DB8540_FUNC_GROUPS(lcd, "lcd_d0_d7_a_1", "lcd_d12_d23_a_1", "lcd_d8_d11_a_1",
  821. "lcdvsi0_a_1", "lcdvsi1_a_1");
  822. DB8540_FUNC_GROUPS(lcdb, "lcdb_a_1");
  823. DB8540_FUNC_GROUPS(mc0, "mc0_a_1");
  824. DB8540_FUNC_GROUPS(mc1, "mc1_a_1", "mc1_a_2");
  825. DB8540_FUNC_GROUPS(mc2, "mc2_a_1", "mc2rstn_c_1");
  826. DB8540_FUNC_GROUPS(mc3, "mc3_b_1");
  827. DB8540_FUNC_GROUPS(mc4, "mc4_a_1", "mc4rstn_c_1");
  828. DB8540_FUNC_GROUPS(mc5, "mc5_c_1");
  829. DB8540_FUNC_GROUPS(modaccgpo, "modaccgpo_c_1", "modaccgpo_oc1_1",
  830. "modaccgpo_oc3_1");
  831. DB8540_FUNC_GROUPS(modaccuart, "modaccuart_oc2_1", "modaccuarttxrx_oc4_1",
  832. "modaccuartrtccts_oc4_1");
  833. DB8540_FUNC_GROUPS(modi2s, "modi2s_a_1");
  834. DB8540_FUNC_GROUPS(modobs, "modobsclk_a_1", "modobsclkout_oc1_1",
  835. "modobspwrctrl_oc1_1", "modobspwrrst_c_1",
  836. "modobsrefclk_oc1_1", "modobsresout_c_1",
  837. "modobsresout_oc1_1", "modobsservice_oc2_1");
  838. DB8540_FUNC_GROUPS(modprcmudbg, "modprcmudbg_oc1_1");
  839. DB8540_FUNC_GROUPS(modrf, "modrf_c_1");
  840. DB8540_FUNC_GROUPS(modsmb, "modsmb_a_1");
  841. DB8540_FUNC_GROUPS(modtrig, "modtrig_b_1");
  842. DB8540_FUNC_GROUPS(moduart, "moduart1_c_1", "moduart1_oc1_1",
  843. "moduart1txrx_oc4_1", "moduart1rtscts_oc4_1", "moduart0_oc2_1");
  844. DB8540_FUNC_GROUPS(moduartstmmux, "moduartstmmux_b_1", "moduartstmmux_oc2_1",
  845. "moduartstmmux_oc4_1");
  846. DB8540_FUNC_GROUPS(modxmip, "modxmip_oc1_1", "modxmip_oc2_1");
  847. /*
  848. * MSP0 can only be on a certain set of pins, but the TX/RX pins can be
  849. * switched around by selecting the altfunction A or B.
  850. */
  851. DB8540_FUNC_GROUPS(msp0, "msp0rfsrck_a_1", "msp0tfstck_a_1", "msp0txrx_a_1",
  852. "msp0txrx_b_1");
  853. DB8540_FUNC_GROUPS(msp1, "msp1_a_1", "msp1txrx_a_1", "msp1txrx_b_1");
  854. DB8540_FUNC_GROUPS(msp2, "msp2sck_a_1", "msp2txdtcktfs_a_1", "msp2rxd_a_1");
  855. DB8540_FUNC_GROUPS(msp4, "msp4_a_1", "msp4_b_1", "msp4_c_1");
  856. DB8540_FUNC_GROUPS(pwl, "pwl_b_1", "pwl_b_2", "pwl_b_3", "pwl_b_4");
  857. DB8540_FUNC_GROUPS(remap, "remap0_oc1_1", "remap1_oc1_1");
  858. DB8540_FUNC_GROUPS(sbag, "sbag_oc2_1", "sbag_oc2_2");
  859. /* Select between CS0 on alt B or PS1 on alt C */
  860. DB8540_FUNC_GROUPS(sm, "sm_b_1", "smcleale_c_1", "smcs0_b_1", "smcs1_b_1",
  861. "smps0_c_1", "smps1_c_1");
  862. DB8540_FUNC_GROUPS(spi0, "spi0_c_1");
  863. DB8540_FUNC_GROUPS(spi1, "spi1_b_1");
  864. DB8540_FUNC_GROUPS(spi2, "spi2_a_1");
  865. DB8540_FUNC_GROUPS(spi3, "spi3_oc1_1");
  866. DB8540_FUNC_GROUPS(ssp0, "ssp0_a_1");
  867. DB8540_FUNC_GROUPS(ssp1, "ssp1_a_1");
  868. DB8540_FUNC_GROUPS(stmape, "stmape_c_1", "stmape_oc1_1", "stmape_oc2_1");
  869. DB8540_FUNC_GROUPS(stmmod, "stmmod_b_1", "stmmod_oc2_1", "stmmod_oc4_1");
  870. DB8540_FUNC_GROUPS(tpui, "tpui_oc3_1");
  871. DB8540_FUNC_GROUPS(u0, "u0_a_1", "u0_c_1");
  872. DB8540_FUNC_GROUPS(u1, "u1ctsrts_a_1", "u1rxtx_a_1");
  873. DB8540_FUNC_GROUPS(u2, "u2_oc1_1", "u2_oc2_1", "u2ctsrts_a_1", "u2ctsrts_oc1_1",
  874. "u2rxtx_c_1", "u2txrx_a_1", "u2txrx_b_1", "u2txrx_b_2",
  875. "u2txrx_oc1_1");
  876. DB8540_FUNC_GROUPS(u3, "u3ctsrts_b_1", "u3rxtx_c_1", "u3txrxa_b_1");
  877. DB8540_FUNC_GROUPS(u4, "u4ctsrts_b_1", "u4ctsrts_c_1", "u4txrx_b_1");
  878. DB8540_FUNC_GROUPS(usb, "usb_a_1");
  879. #define FUNCTION(fname) \
  880. { \
  881. .name = #fname, \
  882. .groups = fname##_groups, \
  883. .ngroups = ARRAY_SIZE(fname##_groups), \
  884. }
  885. static const struct nmk_function nmk_db8540_functions[] = {
  886. FUNCTION(apetrig),
  887. FUNCTION(clkout),
  888. FUNCTION(ddrtrig),
  889. FUNCTION(hsi),
  890. FUNCTION(hwobs),
  891. FUNCTION(hx),
  892. FUNCTION(i2c0),
  893. FUNCTION(i2c1),
  894. FUNCTION(i2c2),
  895. FUNCTION(i2c3),
  896. FUNCTION(i2c4),
  897. FUNCTION(i2c5),
  898. FUNCTION(i2c6),
  899. FUNCTION(ipgpio),
  900. FUNCTION(ipi2c),
  901. FUNCTION(kp),
  902. FUNCTION(lcd),
  903. FUNCTION(lcdb),
  904. FUNCTION(mc0),
  905. FUNCTION(mc1),
  906. FUNCTION(mc2),
  907. FUNCTION(mc3),
  908. FUNCTION(mc4),
  909. FUNCTION(mc5),
  910. FUNCTION(modaccgpo),
  911. FUNCTION(modaccuart),
  912. FUNCTION(modi2s),
  913. FUNCTION(modobs),
  914. FUNCTION(modprcmudbg),
  915. FUNCTION(modrf),
  916. FUNCTION(modsmb),
  917. FUNCTION(modtrig),
  918. FUNCTION(moduart),
  919. FUNCTION(modxmip),
  920. FUNCTION(msp0),
  921. FUNCTION(msp1),
  922. FUNCTION(msp2),
  923. FUNCTION(msp4),
  924. FUNCTION(pwl),
  925. FUNCTION(remap),
  926. FUNCTION(sbag),
  927. FUNCTION(sm),
  928. FUNCTION(spi0),
  929. FUNCTION(spi1),
  930. FUNCTION(spi2),
  931. FUNCTION(spi3),
  932. FUNCTION(ssp0),
  933. FUNCTION(ssp1),
  934. FUNCTION(stmape),
  935. FUNCTION(stmmod),
  936. FUNCTION(tpui),
  937. FUNCTION(u0),
  938. FUNCTION(u1),
  939. FUNCTION(u2),
  940. FUNCTION(u3),
  941. FUNCTION(u4),
  942. FUNCTION(usb)
  943. };
  944. static const struct prcm_gpiocr_altcx_pin_desc db8540_altcx_pins[] = {
  945. PRCM_GPIOCR_ALTCX(8, true, PRCM_IDX_GPIOCR1, 20, /* SPI3_CLK */
  946. false, 0, 0,
  947. false, 0, 0,
  948. false, 0, 0
  949. ),
  950. PRCM_GPIOCR_ALTCX(9, true, PRCM_IDX_GPIOCR1, 20, /* SPI3_RXD */
  951. false, 0, 0,
  952. false, 0, 0,
  953. false, 0, 0
  954. ),
  955. PRCM_GPIOCR_ALTCX(10, true, PRCM_IDX_GPIOCR1, 20, /* SPI3_FRM */
  956. false, 0, 0,
  957. false, 0, 0,
  958. false, 0, 0
  959. ),
  960. PRCM_GPIOCR_ALTCX(11, true, PRCM_IDX_GPIOCR1, 20, /* SPI3_TXD */
  961. false, 0, 0,
  962. false, 0, 0,
  963. false, 0, 0
  964. ),
  965. PRCM_GPIOCR_ALTCX(23, true, PRCM_IDX_GPIOCR1, 9, /* STMAPE_CLK_a */
  966. true, PRCM_IDX_GPIOCR2, 10, /* SBAG_CLK_a */
  967. false, 0, 0,
  968. false, 0, 0
  969. ),
  970. PRCM_GPIOCR_ALTCX(24, true, PRCM_IDX_GPIOCR3, 30, /* U2_RXD_g */
  971. true, PRCM_IDX_GPIOCR2, 10, /* SBAG_VAL_a */
  972. false, 0, 0,
  973. false, 0, 0
  974. ),
  975. PRCM_GPIOCR_ALTCX(25, true, PRCM_IDX_GPIOCR1, 9, /* STMAPE_DAT_a[0] */
  976. true, PRCM_IDX_GPIOCR2, 10, /* SBAG_D_a[0] */
  977. false, 0, 0,
  978. false, 0, 0
  979. ),
  980. PRCM_GPIOCR_ALTCX(26, true, PRCM_IDX_GPIOCR1, 9, /* STMAPE_DAT_a[1] */
  981. true, PRCM_IDX_GPIOCR2, 10, /* SBAG_D_a[1] */
  982. false, 0, 0,
  983. false, 0, 0
  984. ),
  985. PRCM_GPIOCR_ALTCX(27, true, PRCM_IDX_GPIOCR1, 9, /* STMAPE_DAT_a[2] */
  986. true, PRCM_IDX_GPIOCR2, 10, /* SBAG_D_a[2] */
  987. false, 0, 0,
  988. false, 0, 0
  989. ),
  990. PRCM_GPIOCR_ALTCX(28, true, PRCM_IDX_GPIOCR1, 9, /* STMAPE_DAT_a[3] */
  991. true, PRCM_IDX_GPIOCR2, 10, /* SBAG_D_a[3] */
  992. false, 0, 0,
  993. false, 0, 0
  994. ),
  995. PRCM_GPIOCR_ALTCX(64, true, PRCM_IDX_GPIOCR1, 15, /* MODOBS_REFCLK_REQ */
  996. false, 0, 0,
  997. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_CTL */
  998. true, PRCM_IDX_GPIOCR2, 23 /* HW_OBS_APE_PRCMU[17] */
  999. ),
  1000. PRCM_GPIOCR_ALTCX(65, true, PRCM_IDX_GPIOCR1, 19, /* MODOBS_PWRCTRL0 */
  1001. true, PRCM_IDX_GPIOCR1, 24, /* Hx_CLK */
  1002. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_CLK */
  1003. true, PRCM_IDX_GPIOCR2, 24 /* HW_OBS_APE_PRCMU[16] */
  1004. ),
  1005. PRCM_GPIOCR_ALTCX(66, true, PRCM_IDX_GPIOCR1, 15, /* MODOBS_CLKOUT1 */
  1006. false, 0, 0,
  1007. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[15] */
  1008. true, PRCM_IDX_GPIOCR2, 25 /* HW_OBS_APE_PRCMU[15] */
  1009. ),
  1010. PRCM_GPIOCR_ALTCX(67, true, PRCM_IDX_GPIOCR1, 1, /* MODUART1_TXD_a */
  1011. true, PRCM_IDX_GPIOCR1, 6, /* MODACCUART_TXD_a */
  1012. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[14] */
  1013. true, PRCM_IDX_GPIOCR2, 26 /* HW_OBS_APE_PRCMU[14] */
  1014. ),
  1015. PRCM_GPIOCR_ALTCX(70, true, PRCM_IDX_GPIOCR3, 6, /* MOD_PRCMU_DEBUG[17] */
  1016. true, PRCM_IDX_GPIOCR1, 10, /* STMMOD_CLK_b */
  1017. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[13] */
  1018. true, PRCM_IDX_GPIOCR2, 27 /* HW_OBS_APE_PRCMU[13] */
  1019. ),
  1020. PRCM_GPIOCR_ALTCX(71, true, PRCM_IDX_GPIOCR3, 6, /* MOD_PRCMU_DEBUG[16] */
  1021. true, PRCM_IDX_GPIOCR1, 10, /* STMMOD_DAT_b[3] */
  1022. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[12] */
  1023. true, PRCM_IDX_GPIOCR2, 27 /* HW_OBS_APE_PRCMU[12] */
  1024. ),
  1025. PRCM_GPIOCR_ALTCX(72, true, PRCM_IDX_GPIOCR3, 6, /* MOD_PRCMU_DEBUG[15] */
  1026. true, PRCM_IDX_GPIOCR1, 10, /* STMMOD_DAT_b[2] */
  1027. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[11] */
  1028. true, PRCM_IDX_GPIOCR2, 27 /* HW_OBS_APE_PRCMU[11] */
  1029. ),
  1030. PRCM_GPIOCR_ALTCX(73, true, PRCM_IDX_GPIOCR3, 6, /* MOD_PRCMU_DEBUG[14] */
  1031. true, PRCM_IDX_GPIOCR1, 10, /* STMMOD_DAT_b[1] */
  1032. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[10] */
  1033. true, PRCM_IDX_GPIOCR2, 27 /* HW_OBS_APE_PRCMU[10] */
  1034. ),
  1035. PRCM_GPIOCR_ALTCX(74, true, PRCM_IDX_GPIOCR3, 6, /* MOD_PRCMU_DEBUG[13] */
  1036. true, PRCM_IDX_GPIOCR1, 10, /* STMMOD_DAT_b[0] */
  1037. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[9] */
  1038. true, PRCM_IDX_GPIOCR2, 27 /* HW_OBS_APE_PRCMU[9] */
  1039. ),
  1040. PRCM_GPIOCR_ALTCX(75, true, PRCM_IDX_GPIOCR1, 12, /* MODOBS_RESOUT0_N */
  1041. true, PRCM_IDX_GPIOCR2, 1, /* MODUART_STMMUX_RXD_b */
  1042. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[8] */
  1043. true, PRCM_IDX_GPIOCR2, 28 /* HW_OBS_APE_PRCMU[8] */
  1044. ),
  1045. PRCM_GPIOCR_ALTCX(76, true, PRCM_IDX_GPIOCR3, 7, /* MOD_PRCMU_DEBUG[12] */
  1046. true, PRCM_IDX_GPIOCR1, 25, /* Hx_GPIO[7] */
  1047. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[7] */
  1048. true, PRCM_IDX_GPIOCR2, 29 /* HW_OBS_APE_PRCMU[7] */
  1049. ),
  1050. PRCM_GPIOCR_ALTCX(77, true, PRCM_IDX_GPIOCR3, 7, /* MOD_PRCMU_DEBUG[11] */
  1051. true, PRCM_IDX_GPIOCR1, 25, /* Hx_GPIO[6] */
  1052. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[6] */
  1053. true, PRCM_IDX_GPIOCR2, 29 /* HW_OBS_APE_PRCMU[6] */
  1054. ),
  1055. PRCM_GPIOCR_ALTCX(78, true, PRCM_IDX_GPIOCR3, 7, /* MOD_PRCMU_DEBUG[10] */
  1056. true, PRCM_IDX_GPIOCR1, 25, /* Hx_GPIO[5] */
  1057. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[5] */
  1058. true, PRCM_IDX_GPIOCR2, 29 /* HW_OBS_APE_PRCMU[5] */
  1059. ),
  1060. PRCM_GPIOCR_ALTCX(79, true, PRCM_IDX_GPIOCR3, 7, /* MOD_PRCMU_DEBUG[9] */
  1061. true, PRCM_IDX_GPIOCR1, 25, /* Hx_GPIO[4] */
  1062. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[4] */
  1063. true, PRCM_IDX_GPIOCR2, 29 /* HW_OBS_APE_PRCMU[4] */
  1064. ),
  1065. PRCM_GPIOCR_ALTCX(80, true, PRCM_IDX_GPIOCR1, 26, /* MODACC_GPO[0] */
  1066. true, PRCM_IDX_GPIOCR1, 25, /* Hx_GPIO[3] */
  1067. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[3] */
  1068. true, PRCM_IDX_GPIOCR2, 30 /* HW_OBS_APE_PRCMU[3] */
  1069. ),
  1070. PRCM_GPIOCR_ALTCX(81, true, PRCM_IDX_GPIOCR2, 17, /* MODACC_GPO[1] */
  1071. true, PRCM_IDX_GPIOCR1, 25, /* Hx_GPIO[2] */
  1072. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[2] */
  1073. true, PRCM_IDX_GPIOCR2, 30 /* HW_OBS_APE_PRCMU[2] */
  1074. ),
  1075. PRCM_GPIOCR_ALTCX(82, true, PRCM_IDX_GPIOCR3, 8, /* MOD_PRCMU_DEBUG[8] */
  1076. true, PRCM_IDX_GPIOCR1, 25, /* Hx_GPIO[1] */
  1077. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[1] */
  1078. true, PRCM_IDX_GPIOCR2, 31 /* HW_OBS_APE_PRCMU[1] */
  1079. ),
  1080. PRCM_GPIOCR_ALTCX(83, true, PRCM_IDX_GPIOCR3, 8, /* MOD_PRCMU_DEBUG[7] */
  1081. true, PRCM_IDX_GPIOCR1, 25, /* Hx_GPIO[0] */
  1082. true, PRCM_IDX_GPIOCR1, 2, /* TPIU_D[0] */
  1083. true, PRCM_IDX_GPIOCR2, 31 /* HW_OBS_APE_PRCMU[0] */
  1084. ),
  1085. PRCM_GPIOCR_ALTCX(84, true, PRCM_IDX_GPIOCR3, 9, /* MOD_PRCMU_DEBUG[6] */
  1086. true, PRCM_IDX_GPIOCR1, 8, /* SBAG_CLK_b */
  1087. true, PRCM_IDX_GPIOCR1, 3, /* TPIU_D[23] */
  1088. true, PRCM_IDX_GPIOCR1, 16 /* MODUART1_RXD_b */
  1089. ),
  1090. PRCM_GPIOCR_ALTCX(85, true, PRCM_IDX_GPIOCR3, 9, /* MOD_PRCMU_DEBUG[5] */
  1091. true, PRCM_IDX_GPIOCR1, 8, /* SBAG_D_b[3] */
  1092. true, PRCM_IDX_GPIOCR1, 3, /* TPIU_D[22] */
  1093. true, PRCM_IDX_GPIOCR1, 16 /* MODUART1_TXD_b */
  1094. ),
  1095. PRCM_GPIOCR_ALTCX(86, true, PRCM_IDX_GPIOCR3, 9, /* MOD_PRCMU_DEBUG[0] */
  1096. true, PRCM_IDX_GPIOCR2, 18, /* STMAPE_DAT_b[0] */
  1097. true, PRCM_IDX_GPIOCR1, 14, /* TPIU_D[25] */
  1098. true, PRCM_IDX_GPIOCR1, 11 /* STMMOD_DAT_c[0] */
  1099. ),
  1100. PRCM_GPIOCR_ALTCX(87, true, PRCM_IDX_GPIOCR3, 0, /* MODACC_GPO_a[5] */
  1101. true, PRCM_IDX_GPIOCR2, 3, /* U2_RXD_c */
  1102. true, PRCM_IDX_GPIOCR1, 4, /* TPIU_D[24] */
  1103. true, PRCM_IDX_GPIOCR1, 21 /* MODUART_STMMUX_RXD_c */
  1104. ),
  1105. PRCM_GPIOCR_ALTCX(151, true, PRCM_IDX_GPIOCR1, 18, /* REMAP0 */
  1106. false, 0, 0,
  1107. false, 0, 0,
  1108. false, 0, 0
  1109. ),
  1110. PRCM_GPIOCR_ALTCX(152, true, PRCM_IDX_GPIOCR1, 18, /* REMAP1 */
  1111. false, 0, 0,
  1112. false, 0, 0,
  1113. false, 0, 0
  1114. ),
  1115. PRCM_GPIOCR_ALTCX(153, true, PRCM_IDX_GPIOCR3, 2, /* KP_O_b[6] */
  1116. true, PRCM_IDX_GPIOCR1, 8, /* SBAG_D_b[2] */
  1117. true, PRCM_IDX_GPIOCR1, 3, /* TPIU_D[21] */
  1118. true, PRCM_IDX_GPIOCR1, 0 /* MODUART1_RTS */
  1119. ),
  1120. PRCM_GPIOCR_ALTCX(154, true, PRCM_IDX_GPIOCR3, 2, /* KP_I_b[6] */
  1121. true, PRCM_IDX_GPIOCR1, 8, /* SBAG_D_b[1] */
  1122. true, PRCM_IDX_GPIOCR1, 3, /* TPIU_D[20] */
  1123. true, PRCM_IDX_GPIOCR1, 0 /* MODUART1_CTS */
  1124. ),
  1125. PRCM_GPIOCR_ALTCX(155, true, PRCM_IDX_GPIOCR3, 3, /* KP_O_b[5] */
  1126. true, PRCM_IDX_GPIOCR1, 8, /* SBAG_D_b[0] */
  1127. true, PRCM_IDX_GPIOCR1, 3, /* TPIU_D[19] */
  1128. true, PRCM_IDX_GPIOCR1, 5 /* MODACCUART_RXD_c */
  1129. ),
  1130. PRCM_GPIOCR_ALTCX(156, true, PRCM_IDX_GPIOCR3, 3, /* KP_O_b[4] */
  1131. true, PRCM_IDX_GPIOCR1, 8, /* SBAG_VAL_b */
  1132. true, PRCM_IDX_GPIOCR1, 3, /* TPIU_D[18] */
  1133. true, PRCM_IDX_GPIOCR1, 5 /* MODACCUART_TXD_b */
  1134. ),
  1135. PRCM_GPIOCR_ALTCX(157, true, PRCM_IDX_GPIOCR3, 4, /* KP_I_b[5] */
  1136. true, PRCM_IDX_GPIOCR1, 23, /* MODOBS_SERVICE_N */
  1137. true, PRCM_IDX_GPIOCR1, 3, /* TPIU_D[17] */
  1138. true, PRCM_IDX_GPIOCR1, 14 /* MODACCUART_RTS */
  1139. ),
  1140. PRCM_GPIOCR_ALTCX(158, true, PRCM_IDX_GPIOCR3, 4, /* KP_I_b[4] */
  1141. true, PRCM_IDX_GPIOCR2, 0, /* U2_TXD_c */
  1142. true, PRCM_IDX_GPIOCR1, 3, /* TPIU_D[16] */
  1143. true, PRCM_IDX_GPIOCR1, 14 /* MODACCUART_CTS */
  1144. ),
  1145. PRCM_GPIOCR_ALTCX(159, true, PRCM_IDX_GPIOCR3, 5, /* KP_O_b[3] */
  1146. true, PRCM_IDX_GPIOCR3, 10, /* MODUART0_RXD */
  1147. true, PRCM_IDX_GPIOCR1, 4, /* TPIU_D[31] */
  1148. false, 0, 0
  1149. ),
  1150. PRCM_GPIOCR_ALTCX(160, true, PRCM_IDX_GPIOCR3, 5, /* KP_I_b[3] */
  1151. true, PRCM_IDX_GPIOCR3, 10, /* MODUART0_TXD */
  1152. true, PRCM_IDX_GPIOCR1, 4, /* TPIU_D[30] */
  1153. false, 0, 0
  1154. ),
  1155. PRCM_GPIOCR_ALTCX(161, true, PRCM_IDX_GPIOCR3, 9, /* MOD_PRCMU_DEBUG[4] */
  1156. true, PRCM_IDX_GPIOCR2, 18, /* STMAPE_CLK_b */
  1157. true, PRCM_IDX_GPIOCR1, 4, /* TPIU_D[29] */
  1158. true, PRCM_IDX_GPIOCR1, 11 /* STMMOD_CLK_c */
  1159. ),
  1160. PRCM_GPIOCR_ALTCX(162, true, PRCM_IDX_GPIOCR3, 9, /* MOD_PRCMU_DEBUG[3] */
  1161. true, PRCM_IDX_GPIOCR2, 18, /* STMAPE_DAT_b[3] */
  1162. true, PRCM_IDX_GPIOCR1, 4, /* TPIU_D[28] */
  1163. true, PRCM_IDX_GPIOCR1, 11 /* STMMOD_DAT_c[3] */
  1164. ),
  1165. PRCM_GPIOCR_ALTCX(163, true, PRCM_IDX_GPIOCR3, 9, /* MOD_PRCMU_DEBUG[2] */
  1166. true, PRCM_IDX_GPIOCR2, 18, /* STMAPE_DAT_b[2] */
  1167. true, PRCM_IDX_GPIOCR1, 4, /* TPIU_D[27] */
  1168. true, PRCM_IDX_GPIOCR1, 11 /* STMMOD_DAT_c[2] */
  1169. ),
  1170. PRCM_GPIOCR_ALTCX(164, true, PRCM_IDX_GPIOCR3, 9, /* MOD_PRCMU_DEBUG[1] */
  1171. true, PRCM_IDX_GPIOCR2, 18, /* STMAPE_DAT_b[1] */
  1172. true, PRCM_IDX_GPIOCR1, 4, /* TPIU_D[26] */
  1173. true, PRCM_IDX_GPIOCR1, 11 /* STMMOD_DAT_c[1] */
  1174. ),
  1175. PRCM_GPIOCR_ALTCX(204, true, PRCM_IDX_GPIOCR2, 2, /* U2_RXD_f */
  1176. false, 0, 0,
  1177. false, 0, 0,
  1178. false, 0, 0
  1179. ),
  1180. PRCM_GPIOCR_ALTCX(205, true, PRCM_IDX_GPIOCR2, 2, /* U2_TXD_f */
  1181. false, 0, 0,
  1182. false, 0, 0,
  1183. false, 0, 0
  1184. ),
  1185. PRCM_GPIOCR_ALTCX(206, true, PRCM_IDX_GPIOCR2, 2, /* U2_CTSn_b */
  1186. false, 0, 0,
  1187. false, 0, 0,
  1188. false, 0, 0
  1189. ),
  1190. PRCM_GPIOCR_ALTCX(207, true, PRCM_IDX_GPIOCR2, 2, /* U2_RTSn_b */
  1191. false, 0, 0,
  1192. false, 0, 0,
  1193. false, 0, 0
  1194. ),
  1195. };
  1196. static const u16 db8540_prcm_gpiocr_regs[] = {
  1197. [PRCM_IDX_GPIOCR1] = 0x138,
  1198. [PRCM_IDX_GPIOCR2] = 0x574,
  1199. [PRCM_IDX_GPIOCR3] = 0x2bc,
  1200. };
  1201. static const struct nmk_pinctrl_soc_data nmk_db8540_soc = {
  1202. .pins = nmk_db8540_pins,
  1203. .npins = ARRAY_SIZE(nmk_db8540_pins),
  1204. .functions = nmk_db8540_functions,
  1205. .nfunctions = ARRAY_SIZE(nmk_db8540_functions),
  1206. .groups = nmk_db8540_groups,
  1207. .ngroups = ARRAY_SIZE(nmk_db8540_groups),
  1208. .altcx_pins = db8540_altcx_pins,
  1209. .npins_altcx = ARRAY_SIZE(db8540_altcx_pins),
  1210. .prcm_gpiocr_registers = db8540_prcm_gpiocr_regs,
  1211. };
  1212. void nmk_pinctrl_db8540_init(const struct nmk_pinctrl_soc_data **soc)
  1213. {
  1214. *soc = &nmk_db8540_soc;
  1215. }