pinctrl-mmp2.c 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. /*
  2. * linux/drivers/pinctrl/pinmux-mmp2.c
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * publishhed by the Free Software Foundation.
  7. *
  8. * Copyright (C) 2011, Marvell Technology Group Ltd.
  9. *
  10. * Author: Haojian Zhuang <haojian.zhuang@marvell.com>
  11. *
  12. */
  13. #include <linux/device.h>
  14. #include <linux/module.h>
  15. #include <linux/io.h>
  16. #include <linux/platform_device.h>
  17. #include "pinctrl-pxa3xx.h"
  18. #define MMP2_DS_MASK 0x1800
  19. #define MMP2_DS_SHIFT 11
  20. #define MMP2_SLEEP_MASK 0x38
  21. #define MMP2_SLEEP_SELECT (1 << 9)
  22. #define MMP2_SLEEP_DATA (1 << 8)
  23. #define MMP2_SLEEP_DIR (1 << 7)
  24. #define MFPR_MMP2(a, r, f0, f1, f2, f3, f4, f5, f6, f7) \
  25. { \
  26. .name = #a, \
  27. .pin = a, \
  28. .mfpr = r, \
  29. .func = { \
  30. MMP2_MUX_##f0, \
  31. MMP2_MUX_##f1, \
  32. MMP2_MUX_##f2, \
  33. MMP2_MUX_##f3, \
  34. MMP2_MUX_##f4, \
  35. MMP2_MUX_##f5, \
  36. MMP2_MUX_##f6, \
  37. MMP2_MUX_##f7, \
  38. }, \
  39. }
  40. #define GRP_MMP2(a, m, p) \
  41. { .name = a, .mux = MMP2_MUX_##m, .pins = p, .npins = ARRAY_SIZE(p), }
  42. /* 174 pins */
  43. enum mmp2_pin_list {
  44. /* 0~168: GPIO0~GPIO168 */
  45. TWSI4_SCL = 169,
  46. TWSI4_SDA, /* 170 */
  47. G_CLKREQ,
  48. VCXO_REQ,
  49. VCXO_OUT,
  50. };
  51. enum mmp2_mux {
  52. /* PXA3xx_MUX_GPIO = 0 (predefined in pinctrl-pxa3xx.h) */
  53. MMP2_MUX_GPIO = 0,
  54. MMP2_MUX_G_CLKREQ,
  55. MMP2_MUX_VCXO_REQ,
  56. MMP2_MUX_VCXO_OUT,
  57. MMP2_MUX_KP_MK,
  58. MMP2_MUX_KP_DK,
  59. MMP2_MUX_CCIC1,
  60. MMP2_MUX_CCIC2,
  61. MMP2_MUX_SPI,
  62. MMP2_MUX_SSPA2,
  63. MMP2_MUX_ROT,
  64. MMP2_MUX_I2S,
  65. MMP2_MUX_TB,
  66. MMP2_MUX_CAM2,
  67. MMP2_MUX_HDMI,
  68. MMP2_MUX_TWSI2,
  69. MMP2_MUX_TWSI3,
  70. MMP2_MUX_TWSI4,
  71. MMP2_MUX_TWSI5,
  72. MMP2_MUX_TWSI6,
  73. MMP2_MUX_UART1,
  74. MMP2_MUX_UART2,
  75. MMP2_MUX_UART3,
  76. MMP2_MUX_UART4,
  77. MMP2_MUX_SSP1_RX,
  78. MMP2_MUX_SSP1_FRM,
  79. MMP2_MUX_SSP1_TXRX,
  80. MMP2_MUX_SSP2_RX,
  81. MMP2_MUX_SSP2_FRM,
  82. MMP2_MUX_SSP1,
  83. MMP2_MUX_SSP2,
  84. MMP2_MUX_SSP3,
  85. MMP2_MUX_SSP4,
  86. MMP2_MUX_MMC1,
  87. MMP2_MUX_MMC2,
  88. MMP2_MUX_MMC3,
  89. MMP2_MUX_MMC4,
  90. MMP2_MUX_ULPI,
  91. MMP2_MUX_AC,
  92. MMP2_MUX_CA,
  93. MMP2_MUX_PWM,
  94. MMP2_MUX_USIM,
  95. MMP2_MUX_TIPU,
  96. MMP2_MUX_PLL,
  97. MMP2_MUX_NAND,
  98. MMP2_MUX_FSIC,
  99. MMP2_MUX_SLEEP_IND,
  100. MMP2_MUX_EXT_DMA,
  101. MMP2_MUX_ONE_WIRE,
  102. MMP2_MUX_LCD,
  103. MMP2_MUX_SMC,
  104. MMP2_MUX_SMC_INT,
  105. MMP2_MUX_MSP,
  106. MMP2_MUX_G_CLKOUT,
  107. MMP2_MUX_32K_CLKOUT,
  108. MMP2_MUX_PRI_JTAG,
  109. MMP2_MUX_AAS_JTAG,
  110. MMP2_MUX_AAS_GPIO,
  111. MMP2_MUX_AAS_SPI,
  112. MMP2_MUX_AAS_TWSI,
  113. MMP2_MUX_AAS_DEU_EX,
  114. MMP2_MUX_NONE = 0xffff,
  115. };
  116. static struct pinctrl_pin_desc mmp2_pads[] = {
  117. /*
  118. * The name indicates function 0 of this pin.
  119. * After reset, function 0 is the default function of pin.
  120. */
  121. PINCTRL_PIN(GPIO0, "GPIO0"),
  122. PINCTRL_PIN(GPIO1, "GPIO1"),
  123. PINCTRL_PIN(GPIO2, "GPIO2"),
  124. PINCTRL_PIN(GPIO3, "GPIO3"),
  125. PINCTRL_PIN(GPIO4, "GPIO4"),
  126. PINCTRL_PIN(GPIO5, "GPIO5"),
  127. PINCTRL_PIN(GPIO6, "GPIO6"),
  128. PINCTRL_PIN(GPIO7, "GPIO7"),
  129. PINCTRL_PIN(GPIO8, "GPIO8"),
  130. PINCTRL_PIN(GPIO9, "GPIO9"),
  131. PINCTRL_PIN(GPIO10, "GPIO10"),
  132. PINCTRL_PIN(GPIO11, "GPIO11"),
  133. PINCTRL_PIN(GPIO12, "GPIO12"),
  134. PINCTRL_PIN(GPIO13, "GPIO13"),
  135. PINCTRL_PIN(GPIO14, "GPIO14"),
  136. PINCTRL_PIN(GPIO15, "GPIO15"),
  137. PINCTRL_PIN(GPIO16, "GPIO16"),
  138. PINCTRL_PIN(GPIO17, "GPIO17"),
  139. PINCTRL_PIN(GPIO18, "GPIO18"),
  140. PINCTRL_PIN(GPIO19, "GPIO19"),
  141. PINCTRL_PIN(GPIO20, "GPIO20"),
  142. PINCTRL_PIN(GPIO21, "GPIO21"),
  143. PINCTRL_PIN(GPIO22, "GPIO22"),
  144. PINCTRL_PIN(GPIO23, "GPIO23"),
  145. PINCTRL_PIN(GPIO24, "GPIO24"),
  146. PINCTRL_PIN(GPIO25, "GPIO25"),
  147. PINCTRL_PIN(GPIO26, "GPIO26"),
  148. PINCTRL_PIN(GPIO27, "GPIO27"),
  149. PINCTRL_PIN(GPIO28, "GPIO28"),
  150. PINCTRL_PIN(GPIO29, "GPIO29"),
  151. PINCTRL_PIN(GPIO30, "GPIO30"),
  152. PINCTRL_PIN(GPIO31, "GPIO31"),
  153. PINCTRL_PIN(GPIO32, "GPIO32"),
  154. PINCTRL_PIN(GPIO33, "GPIO33"),
  155. PINCTRL_PIN(GPIO34, "GPIO34"),
  156. PINCTRL_PIN(GPIO35, "GPIO35"),
  157. PINCTRL_PIN(GPIO36, "GPIO36"),
  158. PINCTRL_PIN(GPIO37, "GPIO37"),
  159. PINCTRL_PIN(GPIO38, "GPIO38"),
  160. PINCTRL_PIN(GPIO39, "GPIO39"),
  161. PINCTRL_PIN(GPIO40, "GPIO40"),
  162. PINCTRL_PIN(GPIO41, "GPIO41"),
  163. PINCTRL_PIN(GPIO42, "GPIO42"),
  164. PINCTRL_PIN(GPIO43, "GPIO43"),
  165. PINCTRL_PIN(GPIO44, "GPIO44"),
  166. PINCTRL_PIN(GPIO45, "GPIO45"),
  167. PINCTRL_PIN(GPIO46, "GPIO46"),
  168. PINCTRL_PIN(GPIO47, "GPIO47"),
  169. PINCTRL_PIN(GPIO48, "GPIO48"),
  170. PINCTRL_PIN(GPIO49, "GPIO49"),
  171. PINCTRL_PIN(GPIO50, "GPIO50"),
  172. PINCTRL_PIN(GPIO51, "GPIO51"),
  173. PINCTRL_PIN(GPIO52, "GPIO52"),
  174. PINCTRL_PIN(GPIO53, "GPIO53"),
  175. PINCTRL_PIN(GPIO54, "GPIO54"),
  176. PINCTRL_PIN(GPIO55, "GPIO55"),
  177. PINCTRL_PIN(GPIO56, "GPIO56"),
  178. PINCTRL_PIN(GPIO57, "GPIO57"),
  179. PINCTRL_PIN(GPIO58, "GPIO58"),
  180. PINCTRL_PIN(GPIO59, "GPIO59"),
  181. PINCTRL_PIN(GPIO60, "GPIO60"),
  182. PINCTRL_PIN(GPIO61, "GPIO61"),
  183. PINCTRL_PIN(GPIO62, "GPIO62"),
  184. PINCTRL_PIN(GPIO63, "GPIO63"),
  185. PINCTRL_PIN(GPIO64, "GPIO64"),
  186. PINCTRL_PIN(GPIO65, "GPIO65"),
  187. PINCTRL_PIN(GPIO66, "GPIO66"),
  188. PINCTRL_PIN(GPIO67, "GPIO67"),
  189. PINCTRL_PIN(GPIO68, "GPIO68"),
  190. PINCTRL_PIN(GPIO69, "GPIO69"),
  191. PINCTRL_PIN(GPIO70, "GPIO70"),
  192. PINCTRL_PIN(GPIO71, "GPIO71"),
  193. PINCTRL_PIN(GPIO72, "GPIO72"),
  194. PINCTRL_PIN(GPIO73, "GPIO73"),
  195. PINCTRL_PIN(GPIO74, "GPIO74"),
  196. PINCTRL_PIN(GPIO75, "GPIO75"),
  197. PINCTRL_PIN(GPIO76, "GPIO76"),
  198. PINCTRL_PIN(GPIO77, "GPIO77"),
  199. PINCTRL_PIN(GPIO78, "GPIO78"),
  200. PINCTRL_PIN(GPIO79, "GPIO79"),
  201. PINCTRL_PIN(GPIO80, "GPIO80"),
  202. PINCTRL_PIN(GPIO81, "GPIO81"),
  203. PINCTRL_PIN(GPIO82, "GPIO82"),
  204. PINCTRL_PIN(GPIO83, "GPIO83"),
  205. PINCTRL_PIN(GPIO84, "GPIO84"),
  206. PINCTRL_PIN(GPIO85, "GPIO85"),
  207. PINCTRL_PIN(GPIO86, "GPIO86"),
  208. PINCTRL_PIN(GPIO87, "GPIO87"),
  209. PINCTRL_PIN(GPIO88, "GPIO88"),
  210. PINCTRL_PIN(GPIO89, "GPIO89"),
  211. PINCTRL_PIN(GPIO90, "GPIO90"),
  212. PINCTRL_PIN(GPIO91, "GPIO91"),
  213. PINCTRL_PIN(GPIO92, "GPIO92"),
  214. PINCTRL_PIN(GPIO93, "GPIO93"),
  215. PINCTRL_PIN(GPIO94, "GPIO94"),
  216. PINCTRL_PIN(GPIO95, "GPIO95"),
  217. PINCTRL_PIN(GPIO96, "GPIO96"),
  218. PINCTRL_PIN(GPIO97, "GPIO97"),
  219. PINCTRL_PIN(GPIO98, "GPIO98"),
  220. PINCTRL_PIN(GPIO99, "GPIO99"),
  221. PINCTRL_PIN(GPIO100, "GPIO100"),
  222. PINCTRL_PIN(GPIO101, "GPIO101"),
  223. PINCTRL_PIN(GPIO102, "GPIO102"),
  224. PINCTRL_PIN(GPIO103, "GPIO103"),
  225. PINCTRL_PIN(GPIO104, "GPIO104"),
  226. PINCTRL_PIN(GPIO105, "GPIO105"),
  227. PINCTRL_PIN(GPIO106, "GPIO106"),
  228. PINCTRL_PIN(GPIO107, "GPIO107"),
  229. PINCTRL_PIN(GPIO108, "GPIO108"),
  230. PINCTRL_PIN(GPIO109, "GPIO109"),
  231. PINCTRL_PIN(GPIO110, "GPIO110"),
  232. PINCTRL_PIN(GPIO111, "GPIO111"),
  233. PINCTRL_PIN(GPIO112, "GPIO112"),
  234. PINCTRL_PIN(GPIO113, "GPIO113"),
  235. PINCTRL_PIN(GPIO114, "GPIO114"),
  236. PINCTRL_PIN(GPIO115, "GPIO115"),
  237. PINCTRL_PIN(GPIO116, "GPIO116"),
  238. PINCTRL_PIN(GPIO117, "GPIO117"),
  239. PINCTRL_PIN(GPIO118, "GPIO118"),
  240. PINCTRL_PIN(GPIO119, "GPIO119"),
  241. PINCTRL_PIN(GPIO120, "GPIO120"),
  242. PINCTRL_PIN(GPIO121, "GPIO121"),
  243. PINCTRL_PIN(GPIO122, "GPIO122"),
  244. PINCTRL_PIN(GPIO123, "GPIO123"),
  245. PINCTRL_PIN(GPIO124, "GPIO124"),
  246. PINCTRL_PIN(GPIO125, "GPIO125"),
  247. PINCTRL_PIN(GPIO126, "GPIO126"),
  248. PINCTRL_PIN(GPIO127, "GPIO127"),
  249. PINCTRL_PIN(GPIO128, "GPIO128"),
  250. PINCTRL_PIN(GPIO129, "GPIO129"),
  251. PINCTRL_PIN(GPIO130, "GPIO130"),
  252. PINCTRL_PIN(GPIO131, "GPIO131"),
  253. PINCTRL_PIN(GPIO132, "GPIO132"),
  254. PINCTRL_PIN(GPIO133, "GPIO133"),
  255. PINCTRL_PIN(GPIO134, "GPIO134"),
  256. PINCTRL_PIN(GPIO135, "GPIO135"),
  257. PINCTRL_PIN(GPIO136, "GPIO136"),
  258. PINCTRL_PIN(GPIO137, "GPIO137"),
  259. PINCTRL_PIN(GPIO138, "GPIO138"),
  260. PINCTRL_PIN(GPIO139, "GPIO139"),
  261. PINCTRL_PIN(GPIO140, "GPIO140"),
  262. PINCTRL_PIN(GPIO141, "GPIO141"),
  263. PINCTRL_PIN(GPIO142, "GPIO142"),
  264. PINCTRL_PIN(GPIO143, "GPIO143"),
  265. PINCTRL_PIN(GPIO144, "GPIO144"),
  266. PINCTRL_PIN(GPIO145, "GPIO145"),
  267. PINCTRL_PIN(GPIO146, "GPIO146"),
  268. PINCTRL_PIN(GPIO147, "GPIO147"),
  269. PINCTRL_PIN(GPIO148, "GPIO148"),
  270. PINCTRL_PIN(GPIO149, "GPIO149"),
  271. PINCTRL_PIN(GPIO150, "GPIO150"),
  272. PINCTRL_PIN(GPIO151, "GPIO151"),
  273. PINCTRL_PIN(GPIO152, "GPIO152"),
  274. PINCTRL_PIN(GPIO153, "GPIO153"),
  275. PINCTRL_PIN(GPIO154, "GPIO154"),
  276. PINCTRL_PIN(GPIO155, "GPIO155"),
  277. PINCTRL_PIN(GPIO156, "GPIO156"),
  278. PINCTRL_PIN(GPIO157, "GPIO157"),
  279. PINCTRL_PIN(GPIO158, "GPIO158"),
  280. PINCTRL_PIN(GPIO159, "GPIO159"),
  281. PINCTRL_PIN(GPIO160, "GPIO160"),
  282. PINCTRL_PIN(GPIO161, "GPIO161"),
  283. PINCTRL_PIN(GPIO162, "GPIO162"),
  284. PINCTRL_PIN(GPIO163, "GPIO163"),
  285. PINCTRL_PIN(GPIO164, "GPIO164"),
  286. PINCTRL_PIN(GPIO165, "GPIO165"),
  287. PINCTRL_PIN(GPIO166, "GPIO166"),
  288. PINCTRL_PIN(GPIO167, "GPIO167"),
  289. PINCTRL_PIN(GPIO168, "GPIO168"),
  290. PINCTRL_PIN(TWSI4_SCL, "TWSI4_SCL"),
  291. PINCTRL_PIN(TWSI4_SDA, "TWSI4_SDA"),
  292. PINCTRL_PIN(G_CLKREQ, "G_CLKREQ"),
  293. PINCTRL_PIN(VCXO_REQ, "VCXO_REQ"),
  294. PINCTRL_PIN(VCXO_OUT, "VCXO_OUT"),
  295. };
  296. struct pxa3xx_mfp_pin mmp2_mfp[] = {
  297. /* pin offs f0 f1 f2 f3 f4 f5 f6 f7 */
  298. MFPR_MMP2(GPIO0, 0x054, GPIO, KP_MK, NONE, SPI, NONE, NONE, NONE, NONE),
  299. MFPR_MMP2(GPIO1, 0x058, GPIO, KP_MK, NONE, SPI, NONE, NONE, NONE, NONE),
  300. MFPR_MMP2(GPIO2, 0x05C, GPIO, KP_MK, NONE, SPI, NONE, NONE, NONE, NONE),
  301. MFPR_MMP2(GPIO3, 0x060, GPIO, KP_MK, NONE, SPI, NONE, NONE, NONE, NONE),
  302. MFPR_MMP2(GPIO4, 0x064, GPIO, KP_MK, NONE, NONE, NONE, NONE, NONE, NONE),
  303. MFPR_MMP2(GPIO5, 0x068, GPIO, KP_MK, NONE, SPI, NONE, NONE, NONE, NONE),
  304. MFPR_MMP2(GPIO6, 0x06C, GPIO, KP_MK, NONE, SPI, NONE, NONE, NONE, NONE),
  305. MFPR_MMP2(GPIO7, 0x070, GPIO, KP_MK, NONE, SPI, NONE, NONE, NONE, NONE),
  306. MFPR_MMP2(GPIO8, 0x074, GPIO, KP_MK, NONE, NONE, NONE, NONE, NONE, NONE),
  307. MFPR_MMP2(GPIO9, 0x078, GPIO, KP_MK, NONE, NONE, NONE, NONE, NONE, NONE),
  308. MFPR_MMP2(GPIO10, 0x07C, GPIO, KP_MK, NONE, NONE, NONE, NONE, NONE, NONE),
  309. MFPR_MMP2(GPIO11, 0x080, GPIO, KP_MK, NONE, NONE, NONE, NONE, NONE, NONE),
  310. MFPR_MMP2(GPIO12, 0x084, GPIO, KP_MK, NONE, CCIC1, NONE, NONE, NONE, NONE),
  311. MFPR_MMP2(GPIO13, 0x088, GPIO, KP_MK, NONE, CCIC1, NONE, NONE, NONE, NONE),
  312. MFPR_MMP2(GPIO14, 0x08C, GPIO, KP_MK, NONE, CCIC1, NONE, NONE, NONE, NONE),
  313. MFPR_MMP2(GPIO15, 0x090, GPIO, KP_MK, KP_DK, CCIC1, NONE, NONE, NONE, NONE),
  314. MFPR_MMP2(GPIO16, 0x094, GPIO, KP_DK, ROT, CCIC1, NONE, NONE, NONE, NONE),
  315. MFPR_MMP2(GPIO17, 0x098, GPIO, KP_DK, ROT, CCIC1, NONE, NONE, NONE, NONE),
  316. MFPR_MMP2(GPIO18, 0x09C, GPIO, KP_DK, ROT, CCIC1, NONE, NONE, NONE, NONE),
  317. MFPR_MMP2(GPIO19, 0x0A0, GPIO, KP_DK, ROT, CCIC1, NONE, NONE, NONE, NONE),
  318. MFPR_MMP2(GPIO20, 0x0A4, GPIO, KP_DK, TB, CCIC1, NONE, NONE, NONE, NONE),
  319. MFPR_MMP2(GPIO21, 0x0A8, GPIO, KP_DK, TB, CCIC1, NONE, NONE, NONE, NONE),
  320. MFPR_MMP2(GPIO22, 0x0AC, GPIO, KP_DK, TB, CCIC1, NONE, NONE, NONE, NONE),
  321. MFPR_MMP2(GPIO23, 0x0B0, GPIO, KP_DK, TB, CCIC1, NONE, NONE, NONE, NONE),
  322. MFPR_MMP2(GPIO24, 0x0B4, GPIO, I2S, VCXO_OUT, NONE, NONE, NONE, NONE, NONE),
  323. MFPR_MMP2(GPIO25, 0x0B8, GPIO, I2S, HDMI, SSPA2, NONE, NONE, NONE, NONE),
  324. MFPR_MMP2(GPIO26, 0x0BC, GPIO, I2S, HDMI, SSPA2, NONE, NONE, NONE, NONE),
  325. MFPR_MMP2(GPIO27, 0x0C0, GPIO, I2S, HDMI, SSPA2, NONE, NONE, NONE, NONE),
  326. MFPR_MMP2(GPIO28, 0x0C4, GPIO, I2S, NONE, SSPA2, NONE, NONE, NONE, NONE),
  327. MFPR_MMP2(GPIO29, 0x0C8, GPIO, UART1, KP_MK, NONE, NONE, NONE, AAS_SPI, NONE),
  328. MFPR_MMP2(GPIO30, 0x0CC, GPIO, UART1, KP_MK, NONE, NONE, NONE, AAS_SPI, NONE),
  329. MFPR_MMP2(GPIO31, 0x0D0, GPIO, UART1, KP_MK, NONE, NONE, NONE, AAS_SPI, NONE),
  330. MFPR_MMP2(GPIO32, 0x0D4, GPIO, UART1, KP_MK, NONE, NONE, NONE, AAS_SPI, NONE),
  331. MFPR_MMP2(GPIO33, 0x0D8, GPIO, SSPA2, I2S, NONE, NONE, NONE, NONE, NONE),
  332. MFPR_MMP2(GPIO34, 0x0DC, GPIO, SSPA2, I2S, NONE, NONE, NONE, NONE, NONE),
  333. MFPR_MMP2(GPIO35, 0x0E0, GPIO, SSPA2, I2S, NONE, NONE, NONE, NONE, NONE),
  334. MFPR_MMP2(GPIO36, 0x0E4, GPIO, SSPA2, I2S, NONE, NONE, NONE, NONE, NONE),
  335. MFPR_MMP2(GPIO37, 0x0E8, GPIO, MMC2, SSP1, TWSI2, UART2, UART3, AAS_SPI, AAS_TWSI),
  336. MFPR_MMP2(GPIO38, 0x0EC, GPIO, MMC2, SSP1, TWSI2, UART2, UART3, AAS_SPI, AAS_TWSI),
  337. MFPR_MMP2(GPIO39, 0x0F0, GPIO, MMC2, SSP1, TWSI2, UART2, UART3, AAS_SPI, AAS_TWSI),
  338. MFPR_MMP2(GPIO40, 0x0F4, GPIO, MMC2, SSP1, TWSI2, UART2, UART3, AAS_SPI, AAS_TWSI),
  339. MFPR_MMP2(GPIO41, 0x0F8, GPIO, MMC2, TWSI5, NONE, NONE, NONE, NONE, NONE),
  340. MFPR_MMP2(GPIO42, 0x0FC, GPIO, MMC2, TWSI5, NONE, NONE, NONE, NONE, NONE),
  341. MFPR_MMP2(GPIO43, 0x100, GPIO, TWSI2, UART4, SSP1, UART2, UART3, NONE, AAS_TWSI),
  342. MFPR_MMP2(GPIO44, 0x104, GPIO, TWSI2, UART4, SSP1, UART2, UART3, NONE, AAS_TWSI),
  343. MFPR_MMP2(GPIO45, 0x108, GPIO, UART1, UART4, SSP1, UART2, UART3, NONE, NONE),
  344. MFPR_MMP2(GPIO46, 0x10C, GPIO, UART1, UART4, SSP1, UART2, UART3, NONE, NONE),
  345. MFPR_MMP2(GPIO47, 0x110, GPIO, UART2, SSP2, TWSI6, CAM2, AAS_SPI, AAS_GPIO, NONE),
  346. MFPR_MMP2(GPIO48, 0x114, GPIO, UART2, SSP2, TWSI6, CAM2, AAS_SPI, AAS_GPIO, NONE),
  347. MFPR_MMP2(GPIO49, 0x118, GPIO, UART2, SSP2, PWM, CCIC2, AAS_SPI, NONE, NONE),
  348. MFPR_MMP2(GPIO50, 0x11C, GPIO, UART2, SSP2, PWM, CCIC2, AAS_SPI, NONE, NONE),
  349. MFPR_MMP2(GPIO51, 0x120, GPIO, UART3, ROT, AAS_GPIO, PWM, NONE, NONE, NONE),
  350. MFPR_MMP2(GPIO52, 0x124, GPIO, UART3, ROT, AAS_GPIO, PWM, NONE, NONE, NONE),
  351. MFPR_MMP2(GPIO53, 0x128, GPIO, UART3, TWSI2, VCXO_REQ, NONE, PWM, NONE, AAS_TWSI),
  352. MFPR_MMP2(GPIO54, 0x12C, GPIO, UART3, TWSI2, VCXO_OUT, HDMI, PWM, NONE, AAS_TWSI),
  353. MFPR_MMP2(GPIO55, 0x130, GPIO, SSP2, SSP1, UART2, ROT, TWSI2, SSP3, AAS_TWSI),
  354. MFPR_MMP2(GPIO56, 0x134, GPIO, SSP2, SSP1, UART2, ROT, TWSI2, KP_DK, AAS_TWSI),
  355. MFPR_MMP2(GPIO57, 0x138, GPIO, SSP2_RX, SSP1_TXRX, SSP2_FRM, SSP1_RX, VCXO_REQ, KP_DK, NONE),
  356. MFPR_MMP2(GPIO58, 0x13C, GPIO, SSP2, SSP1_RX, SSP1_FRM, SSP1_TXRX, VCXO_REQ, KP_DK, NONE),
  357. MFPR_MMP2(GPIO59, 0x280, GPIO, CCIC1, ULPI, MMC3, CCIC2, UART3, UART4, NONE),
  358. MFPR_MMP2(GPIO60, 0x284, GPIO, CCIC1, ULPI, MMC3, CCIC2, UART3, UART4, NONE),
  359. MFPR_MMP2(GPIO61, 0x288, GPIO, CCIC1, ULPI, MMC3, CCIC2, UART3, HDMI, NONE),
  360. MFPR_MMP2(GPIO62, 0x28C, GPIO, CCIC1, ULPI, MMC3, CCIC2, UART3, NONE, NONE),
  361. MFPR_MMP2(GPIO63, 0x290, GPIO, CCIC1, ULPI, MMC3, CCIC2, MSP, UART4, NONE),
  362. MFPR_MMP2(GPIO64, 0x294, GPIO, CCIC1, ULPI, MMC3, CCIC2, MSP, UART4, NONE),
  363. MFPR_MMP2(GPIO65, 0x298, GPIO, CCIC1, ULPI, MMC3, CCIC2, MSP, UART4, NONE),
  364. MFPR_MMP2(GPIO66, 0x29C, GPIO, CCIC1, ULPI, MMC3, CCIC2, MSP, UART4, NONE),
  365. MFPR_MMP2(GPIO67, 0x2A0, GPIO, CCIC1, ULPI, MMC3, CCIC2, MSP, NONE, NONE),
  366. MFPR_MMP2(GPIO68, 0x2A4, GPIO, CCIC1, ULPI, MMC3, CCIC2, MSP, LCD, NONE),
  367. MFPR_MMP2(GPIO69, 0x2A8, GPIO, CCIC1, ULPI, MMC3, CCIC2, NONE, LCD, NONE),
  368. MFPR_MMP2(GPIO70, 0x2AC, GPIO, CCIC1, ULPI, MMC3, CCIC2, MSP, LCD, NONE),
  369. MFPR_MMP2(GPIO71, 0x2B0, GPIO, TWSI3, NONE, PWM, NONE, NONE, LCD, AAS_TWSI),
  370. MFPR_MMP2(GPIO72, 0x2B4, GPIO, TWSI3, HDMI, PWM, NONE, NONE, LCD, AAS_TWSI),
  371. MFPR_MMP2(GPIO73, 0x2B8, GPIO, VCXO_REQ, 32K_CLKOUT, PWM, VCXO_OUT, NONE, LCD, NONE),
  372. MFPR_MMP2(GPIO74, 0x170, GPIO, LCD, SMC, MMC4, SSP3, UART2, UART4, TIPU),
  373. MFPR_MMP2(GPIO75, 0x174, GPIO, LCD, SMC, MMC4, SSP3, UART2, UART4, TIPU),
  374. MFPR_MMP2(GPIO76, 0x178, GPIO, LCD, SMC, MMC4, SSP3, UART2, UART4, TIPU),
  375. MFPR_MMP2(GPIO77, 0x17C, GPIO, LCD, SMC, MMC4, SSP3, UART2, UART4, TIPU),
  376. MFPR_MMP2(GPIO78, 0x180, GPIO, LCD, HDMI, MMC4, NONE, SSP4, AAS_SPI, TIPU),
  377. MFPR_MMP2(GPIO79, 0x184, GPIO, LCD, AAS_GPIO, MMC4, NONE, SSP4, AAS_SPI, TIPU),
  378. MFPR_MMP2(GPIO80, 0x188, GPIO, LCD, AAS_GPIO, MMC4, NONE, SSP4, AAS_SPI, TIPU),
  379. MFPR_MMP2(GPIO81, 0x18C, GPIO, LCD, AAS_GPIO, MMC4, NONE, SSP4, AAS_SPI, TIPU),
  380. MFPR_MMP2(GPIO82, 0x190, GPIO, LCD, NONE, MMC4, NONE, NONE, CCIC2, TIPU),
  381. MFPR_MMP2(GPIO83, 0x194, GPIO, LCD, NONE, MMC4, NONE, NONE, CCIC2, TIPU),
  382. MFPR_MMP2(GPIO84, 0x198, GPIO, LCD, SMC, MMC2, NONE, TWSI5, AAS_TWSI, TIPU),
  383. MFPR_MMP2(GPIO85, 0x19C, GPIO, LCD, SMC, MMC2, NONE, TWSI5, AAS_TWSI, TIPU),
  384. MFPR_MMP2(GPIO86, 0x1A0, GPIO, LCD, SMC, MMC2, NONE, TWSI6, CCIC2, TIPU),
  385. MFPR_MMP2(GPIO87, 0x1A4, GPIO, LCD, SMC, MMC2, NONE, TWSI6, CCIC2, TIPU),
  386. MFPR_MMP2(GPIO88, 0x1A8, GPIO, LCD, AAS_GPIO, MMC2, NONE, NONE, CCIC2, TIPU),
  387. MFPR_MMP2(GPIO89, 0x1AC, GPIO, LCD, AAS_GPIO, MMC2, NONE, NONE, CCIC2, TIPU),
  388. MFPR_MMP2(GPIO90, 0x1B0, GPIO, LCD, AAS_GPIO, MMC2, NONE, NONE, CCIC2, TIPU),
  389. MFPR_MMP2(GPIO91, 0x1B4, GPIO, LCD, AAS_GPIO, MMC2, NONE, NONE, CCIC2, TIPU),
  390. MFPR_MMP2(GPIO92, 0x1B8, GPIO, LCD, AAS_GPIO, MMC2, NONE, NONE, CCIC2, TIPU),
  391. MFPR_MMP2(GPIO93, 0x1BC, GPIO, LCD, AAS_GPIO, MMC2, NONE, NONE, CCIC2, TIPU),
  392. MFPR_MMP2(GPIO94, 0x1C0, GPIO, LCD, AAS_GPIO, SPI, NONE, AAS_SPI, CCIC2, TIPU),
  393. MFPR_MMP2(GPIO95, 0x1C4, GPIO, LCD, TWSI3, SPI, AAS_DEU_EX, AAS_SPI, CCIC2, TIPU),
  394. MFPR_MMP2(GPIO96, 0x1C8, GPIO, LCD, TWSI3, SPI, AAS_DEU_EX, AAS_SPI, NONE, TIPU),
  395. MFPR_MMP2(GPIO97, 0x1CC, GPIO, LCD, TWSI6, SPI, AAS_DEU_EX, AAS_SPI, NONE, TIPU),
  396. MFPR_MMP2(GPIO98, 0x1D0, GPIO, LCD, TWSI6, SPI, ONE_WIRE, NONE, NONE, TIPU),
  397. MFPR_MMP2(GPIO99, 0x1D4, GPIO, LCD, SMC, SPI, TWSI5, NONE, NONE, TIPU),
  398. MFPR_MMP2(GPIO100, 0x1D8, GPIO, LCD, SMC, SPI, TWSI5, NONE, NONE, TIPU),
  399. MFPR_MMP2(GPIO101, 0x1DC, GPIO, LCD, SMC, SPI, NONE, NONE, NONE, TIPU),
  400. MFPR_MMP2(GPIO102, 0x000, USIM, GPIO, FSIC, KP_DK, LCD, NONE, NONE, NONE),
  401. MFPR_MMP2(GPIO103, 0x004, USIM, GPIO, FSIC, KP_DK, LCD, NONE, NONE, NONE),
  402. MFPR_MMP2(GPIO104, 0x1FC, NAND, GPIO, NONE, NONE, NAND, NONE, NONE, NONE),
  403. MFPR_MMP2(GPIO105, 0x1F8, NAND, GPIO, NONE, NONE, NAND, NONE, NONE, NONE),
  404. MFPR_MMP2(GPIO106, 0x1F4, NAND, GPIO, NONE, NONE, NAND, NONE, NONE, NONE),
  405. MFPR_MMP2(GPIO107, 0x1F0, NAND, GPIO, NONE, NONE, NAND, NONE, NONE, NONE),
  406. MFPR_MMP2(GPIO108, 0x21C, NAND, GPIO, NONE, NONE, NAND, NONE, NONE, NONE),
  407. MFPR_MMP2(GPIO109, 0x218, NAND, GPIO, NONE, NONE, NAND, NONE, NONE, NONE),
  408. MFPR_MMP2(GPIO110, 0x214, NAND, GPIO, NONE, NONE, NAND, NONE, NONE, NONE),
  409. MFPR_MMP2(GPIO111, 0x200, NAND, GPIO, MMC3, NONE, NONE, NONE, NONE, NONE),
  410. MFPR_MMP2(GPIO112, 0x244, NAND, GPIO, MMC3, SMC, NONE, NONE, NONE, NONE),
  411. MFPR_MMP2(GPIO113, 0x25C, SMC, GPIO, EXT_DMA, MMC3, SMC, HDMI, NONE, NONE),
  412. MFPR_MMP2(GPIO114, 0x164, G_CLKOUT, 32K_CLKOUT, HDMI, NONE, NONE, NONE, NONE, NONE),
  413. MFPR_MMP2(GPIO115, 0x260, GPIO, NONE, AC, UART4, UART3, SSP1, NONE, NONE),
  414. MFPR_MMP2(GPIO116, 0x264, GPIO, NONE, AC, UART4, UART3, SSP1, NONE, NONE),
  415. MFPR_MMP2(GPIO117, 0x268, GPIO, NONE, AC, UART4, UART3, SSP1, NONE, NONE),
  416. MFPR_MMP2(GPIO118, 0x26C, GPIO, NONE, AC, UART4, UART3, SSP1, NONE, NONE),
  417. MFPR_MMP2(GPIO119, 0x270, GPIO, NONE, CA, SSP3, NONE, NONE, NONE, NONE),
  418. MFPR_MMP2(GPIO120, 0x274, GPIO, NONE, CA, SSP3, NONE, NONE, NONE, NONE),
  419. MFPR_MMP2(GPIO121, 0x278, GPIO, NONE, CA, SSP3, NONE, NONE, NONE, NONE),
  420. MFPR_MMP2(GPIO122, 0x27C, GPIO, NONE, CA, SSP3, NONE, NONE, NONE, NONE),
  421. MFPR_MMP2(GPIO123, 0x148, GPIO, SLEEP_IND, ONE_WIRE, 32K_CLKOUT, NONE, NONE, NONE, NONE),
  422. MFPR_MMP2(GPIO124, 0x00C, GPIO, MMC1, LCD, MMC3, NAND, NONE, NONE, NONE),
  423. MFPR_MMP2(GPIO125, 0x010, GPIO, MMC1, LCD, MMC3, NAND, NONE, NONE, NONE),
  424. MFPR_MMP2(GPIO126, 0x014, GPIO, MMC1, LCD, MMC3, NAND, NONE, NONE, NONE),
  425. MFPR_MMP2(GPIO127, 0x018, GPIO, NONE, LCD, MMC3, NAND, NONE, NONE, NONE),
  426. MFPR_MMP2(GPIO128, 0x01C, GPIO, NONE, LCD, MMC3, NAND, NONE, NONE, NONE),
  427. MFPR_MMP2(GPIO129, 0x020, GPIO, MMC1, LCD, MMC3, NAND, NONE, NONE, NONE),
  428. MFPR_MMP2(GPIO130, 0x024, GPIO, MMC1, LCD, MMC3, NAND, NONE, NONE, NONE),
  429. MFPR_MMP2(GPIO131, 0x028, GPIO, MMC1, NONE, MSP, NONE, NONE, NONE, NONE),
  430. MFPR_MMP2(GPIO132, 0x02C, GPIO, MMC1, PRI_JTAG, MSP, SSP3, AAS_JTAG, NONE, NONE),
  431. MFPR_MMP2(GPIO133, 0x030, GPIO, MMC1, PRI_JTAG, MSP, SSP3, AAS_JTAG, NONE, NONE),
  432. MFPR_MMP2(GPIO134, 0x034, GPIO, MMC1, PRI_JTAG, MSP, SSP3, AAS_JTAG, NONE, NONE),
  433. MFPR_MMP2(GPIO135, 0x038, GPIO, NONE, LCD, MMC3, NAND, NONE, NONE, NONE),
  434. MFPR_MMP2(GPIO136, 0x03C, GPIO, MMC1, PRI_JTAG, MSP, SSP3, AAS_JTAG, NONE, NONE),
  435. MFPR_MMP2(GPIO137, 0x040, GPIO, HDMI, LCD, MSP, NONE, NONE, NONE, NONE),
  436. MFPR_MMP2(GPIO138, 0x044, GPIO, NONE, LCD, MMC3, SMC, NONE, NONE, NONE),
  437. MFPR_MMP2(GPIO139, 0x048, GPIO, MMC1, PRI_JTAG, MSP, NONE, AAS_JTAG, NONE, NONE),
  438. MFPR_MMP2(GPIO140, 0x04C, GPIO, MMC1, LCD, NONE, NONE, UART2, UART1, NONE),
  439. MFPR_MMP2(GPIO141, 0x050, GPIO, MMC1, LCD, NONE, NONE, UART2, UART1, NONE),
  440. MFPR_MMP2(GPIO142, 0x008, USIM, GPIO, FSIC, KP_DK, NONE, NONE, NONE, NONE),
  441. MFPR_MMP2(GPIO143, 0x220, NAND, GPIO, SMC, NONE, NAND, NONE, NONE, NONE),
  442. MFPR_MMP2(GPIO144, 0x224, NAND, GPIO, SMC_INT, SMC, NAND, NONE, NONE, NONE),
  443. MFPR_MMP2(GPIO145, 0x228, SMC, GPIO, NONE, NONE, SMC, NONE, NONE, NONE),
  444. MFPR_MMP2(GPIO146, 0x22C, SMC, GPIO, NONE, NONE, SMC, NONE, NONE, NONE),
  445. MFPR_MMP2(GPIO147, 0x230, NAND, GPIO, NONE, NONE, NAND, NONE, NONE, NONE),
  446. MFPR_MMP2(GPIO148, 0x234, NAND, GPIO, NONE, NONE, NAND, NONE, NONE, NONE),
  447. MFPR_MMP2(GPIO149, 0x238, NAND, GPIO, NONE, NONE, NONE, NONE, NONE, NONE),
  448. MFPR_MMP2(GPIO150, 0x23C, NAND, GPIO, NONE, NONE, NAND, NONE, NONE, NONE),
  449. MFPR_MMP2(GPIO151, 0x240, SMC, GPIO, MMC3, NONE, NONE, NONE, NONE, NONE),
  450. MFPR_MMP2(GPIO152, 0x248, SMC, GPIO, NONE, NONE, SMC, NONE, NONE, NONE),
  451. MFPR_MMP2(GPIO153, 0x24C, SMC, GPIO, NONE, NONE, SMC, NONE, NONE, NONE),
  452. MFPR_MMP2(GPIO154, 0x254, SMC_INT, GPIO, SMC, NONE, NAND, NONE, NONE, NONE),
  453. MFPR_MMP2(GPIO155, 0x258, EXT_DMA, GPIO, SMC, NONE, EXT_DMA, NONE, NONE, NONE),
  454. MFPR_MMP2(GPIO156, 0x14C, PRI_JTAG, GPIO, PWM, NONE, NONE, NONE, NONE, NONE),
  455. MFPR_MMP2(GPIO157, 0x150, PRI_JTAG, GPIO, PWM, NONE, NONE, NONE, NONE, NONE),
  456. MFPR_MMP2(GPIO158, 0x154, PRI_JTAG, GPIO, PWM, NONE, NONE, NONE, NONE, NONE),
  457. MFPR_MMP2(GPIO159, 0x158, PRI_JTAG, GPIO, PWM, NONE, NONE, NONE, NONE, NONE),
  458. MFPR_MMP2(GPIO160, 0x250, NAND, GPIO, SMC, NONE, NAND, NONE, NONE, NONE),
  459. MFPR_MMP2(GPIO161, 0x210, NAND, GPIO, NONE, NONE, NAND, NONE, NONE, NONE),
  460. MFPR_MMP2(GPIO162, 0x20C, NAND, GPIO, MMC3, NONE, NONE, NONE, NONE, NONE),
  461. MFPR_MMP2(GPIO163, 0x208, NAND, GPIO, MMC3, NONE, NONE, NONE, NONE, NONE),
  462. MFPR_MMP2(GPIO164, 0x204, NAND, GPIO, MMC3, NONE, NONE, NONE, NONE, NONE),
  463. MFPR_MMP2(GPIO165, 0x1EC, NAND, GPIO, MMC3, NONE, NONE, NONE, NONE, NONE),
  464. MFPR_MMP2(GPIO166, 0x1E8, NAND, GPIO, MMC3, NONE, NONE, NONE, NONE, NONE),
  465. MFPR_MMP2(GPIO167, 0x1E4, NAND, GPIO, MMC3, NONE, NONE, NONE, NONE, NONE),
  466. MFPR_MMP2(GPIO168, 0x1E0, NAND, GPIO, MMC3, NONE, NONE, NONE, NONE, NONE),
  467. MFPR_MMP2(TWSI4_SCL, 0x2BC, TWSI4, LCD, NONE, NONE, NONE, NONE, NONE, NONE),
  468. MFPR_MMP2(TWSI4_SDA, 0x2C0, TWSI4, LCD, NONE, NONE, NONE, NONE, NONE, NONE),
  469. MFPR_MMP2(G_CLKREQ, 0x160, G_CLKREQ, ONE_WIRE, NONE, NONE, NONE, NONE, NONE, NONE),
  470. MFPR_MMP2(VCXO_REQ, 0x168, VCXO_REQ, ONE_WIRE, PLL, NONE, NONE, NONE, NONE, NONE),
  471. MFPR_MMP2(VCXO_OUT, 0x16C, VCXO_OUT, 32K_CLKOUT, NONE, NONE, NONE, NONE, NONE, NONE),
  472. };
  473. static const unsigned mmp2_uart1_pin1[] = {GPIO29, GPIO30, GPIO31, GPIO32};
  474. static const unsigned mmp2_uart1_pin2[] = {GPIO45, GPIO46};
  475. static const unsigned mmp2_uart1_pin3[] = {GPIO140, GPIO141};
  476. static const unsigned mmp2_uart2_pin1[] = {GPIO37, GPIO38, GPIO39, GPIO40};
  477. static const unsigned mmp2_uart2_pin2[] = {GPIO43, GPIO44, GPIO45, GPIO46};
  478. static const unsigned mmp2_uart2_pin3[] = {GPIO47, GPIO48, GPIO49, GPIO50};
  479. static const unsigned mmp2_uart2_pin4[] = {GPIO74, GPIO75, GPIO76, GPIO77};
  480. static const unsigned mmp2_uart2_pin5[] = {GPIO55, GPIO56};
  481. static const unsigned mmp2_uart2_pin6[] = {GPIO140, GPIO141};
  482. static const unsigned mmp2_uart3_pin1[] = {GPIO37, GPIO38, GPIO39, GPIO40};
  483. static const unsigned mmp2_uart3_pin2[] = {GPIO43, GPIO44, GPIO45, GPIO46};
  484. static const unsigned mmp2_uart3_pin3[] = {GPIO51, GPIO52, GPIO53, GPIO54};
  485. static const unsigned mmp2_uart3_pin4[] = {GPIO59, GPIO60, GPIO61, GPIO62};
  486. static const unsigned mmp2_uart3_pin5[] = {GPIO115, GPIO116, GPIO117, GPIO118};
  487. static const unsigned mmp2_uart3_pin6[] = {GPIO51, GPIO52};
  488. static const unsigned mmp2_uart4_pin1[] = {GPIO43, GPIO44, GPIO45, GPIO46};
  489. static const unsigned mmp2_uart4_pin2[] = {GPIO63, GPIO64, GPIO65, GPIO66};
  490. static const unsigned mmp2_uart4_pin3[] = {GPIO74, GPIO75, GPIO76, GPIO77};
  491. static const unsigned mmp2_uart4_pin4[] = {GPIO115, GPIO116, GPIO117, GPIO118};
  492. static const unsigned mmp2_uart4_pin5[] = {GPIO59, GPIO60};
  493. static const unsigned mmp2_kpdk_pin1[] = {GPIO16, GPIO17, GPIO18, GPIO19};
  494. static const unsigned mmp2_kpdk_pin2[] = {GPIO16, GPIO17};
  495. static const unsigned mmp2_twsi2_pin1[] = {GPIO37, GPIO38};
  496. static const unsigned mmp2_twsi2_pin2[] = {GPIO39, GPIO40};
  497. static const unsigned mmp2_twsi2_pin3[] = {GPIO43, GPIO44};
  498. static const unsigned mmp2_twsi2_pin4[] = {GPIO53, GPIO54};
  499. static const unsigned mmp2_twsi2_pin5[] = {GPIO55, GPIO56};
  500. static const unsigned mmp2_twsi3_pin1[] = {GPIO71, GPIO72};
  501. static const unsigned mmp2_twsi3_pin2[] = {GPIO95, GPIO96};
  502. static const unsigned mmp2_twsi4_pin1[] = {TWSI4_SCL, TWSI4_SDA};
  503. static const unsigned mmp2_twsi5_pin1[] = {GPIO41, GPIO42};
  504. static const unsigned mmp2_twsi5_pin2[] = {GPIO84, GPIO85};
  505. static const unsigned mmp2_twsi5_pin3[] = {GPIO99, GPIO100};
  506. static const unsigned mmp2_twsi6_pin1[] = {GPIO47, GPIO48};
  507. static const unsigned mmp2_twsi6_pin2[] = {GPIO86, GPIO87};
  508. static const unsigned mmp2_twsi6_pin3[] = {GPIO97, GPIO98};
  509. static const unsigned mmp2_ccic1_pin1[] = {GPIO12, GPIO13, GPIO14, GPIO15,
  510. GPIO16, GPIO17, GPIO18, GPIO19, GPIO20, GPIO21, GPIO22, GPIO23};
  511. static const unsigned mmp2_ccic1_pin2[] = {GPIO59, GPIO60, GPIO61, GPIO62,
  512. GPIO63, GPIO64, GPIO65, GPIO66, GPIO67, GPIO68, GPIO69, GPIO70};
  513. static const unsigned mmp2_ccic2_pin1[] = {GPIO59, GPIO60, GPIO61, GPIO62,
  514. GPIO63, GPIO64, GPIO65, GPIO66, GPIO67, GPIO68, GPIO69, GPIO70};
  515. static const unsigned mmp2_ccic2_pin2[] = {GPIO82, GPIO83, GPIO86, GPIO87,
  516. GPIO88, GPIO89, GPIO90, GPIO91, GPIO92, GPIO93, GPIO94, GPIO95};
  517. static const unsigned mmp2_ulpi_pin1[] = {GPIO59, GPIO60, GPIO61, GPIO62,
  518. GPIO63, GPIO64, GPIO65, GPIO66, GPIO67, GPIO68, GPIO69, GPIO70};
  519. static const unsigned mmp2_ro_pin1[] = {GPIO16, GPIO17};
  520. static const unsigned mmp2_ro_pin2[] = {GPIO18, GPIO19};
  521. static const unsigned mmp2_ro_pin3[] = {GPIO51, GPIO52};
  522. static const unsigned mmp2_ro_pin4[] = {GPIO55, GPIO56};
  523. static const unsigned mmp2_i2s_pin1[] = {GPIO24, GPIO25, GPIO26, GPIO27,
  524. GPIO28};
  525. static const unsigned mmp2_i2s_pin2[] = {GPIO33, GPIO34, GPIO35, GPIO36};
  526. static const unsigned mmp2_ssp1_pin1[] = {GPIO37, GPIO38, GPIO39, GPIO40};
  527. static const unsigned mmp2_ssp1_pin2[] = {GPIO43, GPIO44, GPIO45, GPIO46};
  528. static const unsigned mmp2_ssp1_pin3[] = {GPIO115, GPIO116, GPIO117, GPIO118};
  529. static const unsigned mmp2_ssp2_pin1[] = {GPIO47, GPIO48, GPIO49, GPIO50};
  530. static const unsigned mmp2_ssp3_pin1[] = {GPIO119, GPIO120, GPIO121, GPIO122};
  531. static const unsigned mmp2_ssp3_pin2[] = {GPIO132, GPIO133, GPIO133, GPIO136};
  532. static const unsigned mmp2_sspa2_pin1[] = {GPIO25, GPIO26, GPIO27, GPIO28};
  533. static const unsigned mmp2_sspa2_pin2[] = {GPIO33, GPIO34, GPIO35, GPIO36};
  534. static const unsigned mmp2_mmc1_pin1[] = {GPIO131, GPIO132, GPIO133, GPIO134,
  535. GPIO136, GPIO139, GPIO140, GPIO141};
  536. static const unsigned mmp2_mmc2_pin1[] = {GPIO37, GPIO38, GPIO39, GPIO40,
  537. GPIO41, GPIO42};
  538. static const unsigned mmp2_mmc3_pin1[] = {GPIO111, GPIO112, GPIO151, GPIO162,
  539. GPIO163, GPIO164, GPIO165, GPIO166, GPIO167, GPIO168};
  540. static struct pxa3xx_pin_group mmp2_grps[] = {
  541. GRP_MMP2("uart1 4p1", UART1, mmp2_uart1_pin1),
  542. GRP_MMP2("uart1 2p2", UART1, mmp2_uart1_pin2),
  543. GRP_MMP2("uart1 2p3", UART1, mmp2_uart1_pin3),
  544. GRP_MMP2("uart2 4p1", UART2, mmp2_uart2_pin1),
  545. GRP_MMP2("uart2 4p2", UART2, mmp2_uart2_pin2),
  546. GRP_MMP2("uart2 4p3", UART2, mmp2_uart2_pin3),
  547. GRP_MMP2("uart2 4p4", UART2, mmp2_uart2_pin4),
  548. GRP_MMP2("uart2 2p5", UART2, mmp2_uart2_pin5),
  549. GRP_MMP2("uart2 2p6", UART2, mmp2_uart2_pin6),
  550. GRP_MMP2("uart3 4p1", UART3, mmp2_uart3_pin1),
  551. GRP_MMP2("uart3 4p2", UART3, mmp2_uart3_pin2),
  552. GRP_MMP2("uart3 4p3", UART3, mmp2_uart3_pin3),
  553. GRP_MMP2("uart3 4p4", UART3, mmp2_uart3_pin4),
  554. GRP_MMP2("uart3 4p5", UART3, mmp2_uart3_pin5),
  555. GRP_MMP2("uart3 2p6", UART3, mmp2_uart3_pin6),
  556. GRP_MMP2("uart4 4p1", UART4, mmp2_uart4_pin1),
  557. GRP_MMP2("uart4 4p2", UART4, mmp2_uart4_pin2),
  558. GRP_MMP2("uart4 4p3", UART4, mmp2_uart4_pin3),
  559. GRP_MMP2("uart4 4p4", UART4, mmp2_uart4_pin4),
  560. GRP_MMP2("uart4 2p5", UART4, mmp2_uart4_pin5),
  561. GRP_MMP2("kpdk 4p1", KP_DK, mmp2_kpdk_pin1),
  562. GRP_MMP2("kpdk 4p2", KP_DK, mmp2_kpdk_pin2),
  563. GRP_MMP2("twsi2-1", TWSI2, mmp2_twsi2_pin1),
  564. GRP_MMP2("twsi2-2", TWSI2, mmp2_twsi2_pin2),
  565. GRP_MMP2("twsi2-3", TWSI2, mmp2_twsi2_pin3),
  566. GRP_MMP2("twsi2-4", TWSI2, mmp2_twsi2_pin4),
  567. GRP_MMP2("twsi2-5", TWSI2, mmp2_twsi2_pin5),
  568. GRP_MMP2("twsi3-1", TWSI3, mmp2_twsi3_pin1),
  569. GRP_MMP2("twsi3-2", TWSI3, mmp2_twsi3_pin2),
  570. GRP_MMP2("twsi4", TWSI4, mmp2_twsi4_pin1),
  571. GRP_MMP2("twsi5-1", TWSI5, mmp2_twsi5_pin1),
  572. GRP_MMP2("twsi5-2", TWSI5, mmp2_twsi5_pin2),
  573. GRP_MMP2("twsi5-3", TWSI5, mmp2_twsi5_pin3),
  574. GRP_MMP2("twsi6-1", TWSI6, mmp2_twsi6_pin1),
  575. GRP_MMP2("twsi6-2", TWSI6, mmp2_twsi6_pin2),
  576. GRP_MMP2("twsi6-3", TWSI6, mmp2_twsi6_pin3),
  577. GRP_MMP2("ccic1-1", CCIC1, mmp2_ccic1_pin1),
  578. GRP_MMP2("ccic1-2", CCIC1, mmp2_ccic1_pin2),
  579. GRP_MMP2("ccic2-1", CCIC2, mmp2_ccic2_pin1),
  580. GRP_MMP2("ccic2-1", CCIC2, mmp2_ccic2_pin2),
  581. GRP_MMP2("ulpi", ULPI, mmp2_ulpi_pin1),
  582. GRP_MMP2("ro-1", ROT, mmp2_ro_pin1),
  583. GRP_MMP2("ro-2", ROT, mmp2_ro_pin2),
  584. GRP_MMP2("ro-3", ROT, mmp2_ro_pin3),
  585. GRP_MMP2("ro-4", ROT, mmp2_ro_pin4),
  586. GRP_MMP2("i2s 5p1", I2S, mmp2_i2s_pin1),
  587. GRP_MMP2("i2s 4p2", I2S, mmp2_i2s_pin2),
  588. GRP_MMP2("ssp1 4p1", SSP1, mmp2_ssp1_pin1),
  589. GRP_MMP2("ssp1 4p2", SSP1, mmp2_ssp1_pin2),
  590. GRP_MMP2("ssp1 4p3", SSP1, mmp2_ssp1_pin3),
  591. GRP_MMP2("ssp2 4p1", SSP2, mmp2_ssp2_pin1),
  592. GRP_MMP2("ssp3 4p1", SSP3, mmp2_ssp3_pin1),
  593. GRP_MMP2("ssp3 4p2", SSP3, mmp2_ssp3_pin2),
  594. GRP_MMP2("sspa2 4p1", SSPA2, mmp2_sspa2_pin1),
  595. GRP_MMP2("sspa2 4p2", SSPA2, mmp2_sspa2_pin2),
  596. GRP_MMP2("mmc1 8p1", MMC1, mmp2_mmc1_pin1),
  597. GRP_MMP2("mmc2 6p1", MMC2, mmp2_mmc2_pin1),
  598. GRP_MMP2("mmc3 10p1", MMC3, mmp2_mmc3_pin1),
  599. };
  600. static const char * const mmp2_uart1_grps[] = {"uart1 4p1", "uart1 2p2",
  601. "uart1 2p3"};
  602. static const char * const mmp2_uart2_grps[] = {"uart2 4p1", "uart2 4p2",
  603. "uart2 4p3", "uart2 4p4", "uart2 4p5", "uart2 4p6"};
  604. static const char * const mmp2_uart3_grps[] = {"uart3 4p1", "uart3 4p2",
  605. "uart3 4p3", "uart3 4p4", "uart3 4p5", "uart3 2p6"};
  606. static const char * const mmp2_uart4_grps[] = {"uart4 4p1", "uart4 4p2",
  607. "uart4 4p3", "uart4 4p4", "uart4 2p5"};
  608. static const char * const mmp2_kpdk_grps[] = {"kpdk 4p1", "kpdk 4p2"};
  609. static const char * const mmp2_twsi2_grps[] = {"twsi2-1", "twsi2-2",
  610. "twsi2-3", "twsi2-4", "twsi2-5"};
  611. static const char * const mmp2_twsi3_grps[] = {"twsi3-1", "twsi3-2"};
  612. static const char * const mmp2_twsi4_grps[] = {"twsi4"};
  613. static const char * const mmp2_twsi5_grps[] = {"twsi5-1", "twsi5-2",
  614. "twsi5-3"};
  615. static const char * const mmp2_twsi6_grps[] = {"twsi6-1", "twsi6-2",
  616. "twsi6-3"};
  617. static const char * const mmp2_ccic1_grps[] = {"ccic1-1", "ccic1-2"};
  618. static const char * const mmp2_ccic2_grps[] = {"ccic2-1", "ccic2-2"};
  619. static const char * const mmp2_ulpi_grps[] = {"ulpi"};
  620. static const char * const mmp2_ro_grps[] = {"ro-1", "ro-2", "ro-3", "ro-4"};
  621. static const char * const mmp2_i2s_grps[] = {"i2s 5p1", "i2s 4p2"};
  622. static const char * const mmp2_ssp1_grps[] = {"ssp1 4p1", "ssp1 4p2",
  623. "ssp1 4p3"};
  624. static const char * const mmp2_ssp2_grps[] = {"ssp2 4p1"};
  625. static const char * const mmp2_ssp3_grps[] = {"ssp3 4p1", "ssp3 4p2"};
  626. static const char * const mmp2_sspa2_grps[] = {"sspa2 4p1", "sspa2 4p2"};
  627. static const char * const mmp2_mmc1_grps[] = {"mmc1 8p1"};
  628. static const char * const mmp2_mmc2_grps[] = {"mmc2 6p1"};
  629. static const char * const mmp2_mmc3_grps[] = {"mmc3 10p1"};
  630. static struct pxa3xx_pmx_func mmp2_funcs[] = {
  631. {"uart1", ARRAY_AND_SIZE(mmp2_uart1_grps)},
  632. {"uart2", ARRAY_AND_SIZE(mmp2_uart2_grps)},
  633. {"uart3", ARRAY_AND_SIZE(mmp2_uart3_grps)},
  634. {"uart4", ARRAY_AND_SIZE(mmp2_uart4_grps)},
  635. {"kpdk", ARRAY_AND_SIZE(mmp2_kpdk_grps)},
  636. {"twsi2", ARRAY_AND_SIZE(mmp2_twsi2_grps)},
  637. {"twsi3", ARRAY_AND_SIZE(mmp2_twsi3_grps)},
  638. {"twsi4", ARRAY_AND_SIZE(mmp2_twsi4_grps)},
  639. {"twsi5", ARRAY_AND_SIZE(mmp2_twsi5_grps)},
  640. {"twsi6", ARRAY_AND_SIZE(mmp2_twsi6_grps)},
  641. {"ccic1", ARRAY_AND_SIZE(mmp2_ccic1_grps)},
  642. {"ccic2", ARRAY_AND_SIZE(mmp2_ccic2_grps)},
  643. {"ulpi", ARRAY_AND_SIZE(mmp2_ulpi_grps)},
  644. {"ro", ARRAY_AND_SIZE(mmp2_ro_grps)},
  645. {"i2s", ARRAY_AND_SIZE(mmp2_i2s_grps)},
  646. {"ssp1", ARRAY_AND_SIZE(mmp2_ssp1_grps)},
  647. {"ssp2", ARRAY_AND_SIZE(mmp2_ssp2_grps)},
  648. {"ssp3", ARRAY_AND_SIZE(mmp2_ssp3_grps)},
  649. {"sspa2", ARRAY_AND_SIZE(mmp2_sspa2_grps)},
  650. {"mmc1", ARRAY_AND_SIZE(mmp2_mmc1_grps)},
  651. {"mmc2", ARRAY_AND_SIZE(mmp2_mmc2_grps)},
  652. {"mmc3", ARRAY_AND_SIZE(mmp2_mmc3_grps)},
  653. };
  654. static struct pinctrl_desc mmp2_pctrl_desc = {
  655. .name = "mmp2-pinctrl",
  656. .owner = THIS_MODULE,
  657. };
  658. static struct pxa3xx_pinmux_info mmp2_info = {
  659. .mfp = mmp2_mfp,
  660. .num_mfp = ARRAY_SIZE(mmp2_mfp),
  661. .grps = mmp2_grps,
  662. .num_grps = ARRAY_SIZE(mmp2_grps),
  663. .funcs = mmp2_funcs,
  664. .num_funcs = ARRAY_SIZE(mmp2_funcs),
  665. .num_gpio = 169,
  666. .desc = &mmp2_pctrl_desc,
  667. .pads = mmp2_pads,
  668. .num_pads = ARRAY_SIZE(mmp2_pads),
  669. .cputype = PINCTRL_MMP2,
  670. .ds_mask = MMP2_DS_MASK,
  671. .ds_shift = MMP2_DS_SHIFT,
  672. };
  673. static int __devinit mmp2_pinmux_probe(struct platform_device *pdev)
  674. {
  675. return pxa3xx_pinctrl_register(pdev, &mmp2_info);
  676. }
  677. static int __devexit mmp2_pinmux_remove(struct platform_device *pdev)
  678. {
  679. return pxa3xx_pinctrl_unregister(pdev);
  680. }
  681. static struct platform_driver mmp2_pinmux_driver = {
  682. .driver = {
  683. .name = "mmp2-pinmux",
  684. .owner = THIS_MODULE,
  685. },
  686. .probe = mmp2_pinmux_probe,
  687. .remove = __devexit_p(mmp2_pinmux_remove),
  688. };
  689. static int __init mmp2_pinmux_init(void)
  690. {
  691. return platform_driver_register(&mmp2_pinmux_driver);
  692. }
  693. core_initcall_sync(mmp2_pinmux_init);
  694. static void __exit mmp2_pinmux_exit(void)
  695. {
  696. platform_driver_unregister(&mmp2_pinmux_driver);
  697. }
  698. module_exit(mmp2_pinmux_exit);
  699. MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>");
  700. MODULE_DESCRIPTION("PXA3xx pin control driver");
  701. MODULE_LICENSE("GPL v2");