pinctrl-pic32.c 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314
  1. /*
  2. * PIC32 pinctrl driver
  3. *
  4. * Joshua Henderson, <joshua.henderson@microchip.com>
  5. * Copyright (C) 2015 Microchip Technology Inc. All rights reserved.
  6. *
  7. * This program is free software; you can distribute it and/or modify it
  8. * under the terms of the GNU General Public License (Version 2) as
  9. * published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14. * for more details.
  15. */
  16. #include <linux/clk.h>
  17. #include <linux/gpio/driver.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/io.h>
  20. #include <linux/irq.h>
  21. #include <linux/of.h>
  22. #include <linux/of_device.h>
  23. #include <linux/pinctrl/pinconf.h>
  24. #include <linux/pinctrl/pinconf-generic.h>
  25. #include <linux/pinctrl/pinctrl.h>
  26. #include <linux/pinctrl/pinmux.h>
  27. #include <linux/platform_device.h>
  28. #include <linux/slab.h>
  29. #include <linux/spinlock.h>
  30. #include <asm/mach-pic32/pic32.h>
  31. #include "pinctrl-utils.h"
  32. #include "pinctrl-pic32.h"
  33. #define PINS_PER_BANK 16
  34. #define PIC32_CNCON_EDGE 11
  35. #define PIC32_CNCON_ON 15
  36. #define PIN_CONFIG_MICROCHIP_DIGITAL (PIN_CONFIG_END + 1)
  37. #define PIN_CONFIG_MICROCHIP_ANALOG (PIN_CONFIG_END + 2)
  38. static const struct pinconf_generic_params pic32_mpp_bindings[] = {
  39. {"microchip,digital", PIN_CONFIG_MICROCHIP_DIGITAL, 0},
  40. {"microchip,analog", PIN_CONFIG_MICROCHIP_ANALOG, 0},
  41. };
  42. #define GPIO_BANK_START(bank) ((bank) * PINS_PER_BANK)
  43. struct pic32_function {
  44. const char *name;
  45. const char * const *groups;
  46. unsigned int ngroups;
  47. };
  48. struct pic32_pin_group {
  49. const char *name;
  50. unsigned int pin;
  51. struct pic32_desc_function *functions;
  52. };
  53. struct pic32_desc_function {
  54. const char *name;
  55. u32 muxreg;
  56. u32 muxval;
  57. };
  58. struct pic32_gpio_bank {
  59. void __iomem *reg_base;
  60. struct gpio_chip gpio_chip;
  61. struct irq_chip irq_chip;
  62. struct clk *clk;
  63. };
  64. struct pic32_pinctrl {
  65. void __iomem *reg_base;
  66. struct device *dev;
  67. struct pinctrl_dev *pctldev;
  68. const struct pinctrl_pin_desc *pins;
  69. unsigned int npins;
  70. const struct pic32_function *functions;
  71. unsigned int nfunctions;
  72. const struct pic32_pin_group *groups;
  73. unsigned int ngroups;
  74. struct pic32_gpio_bank *gpio_banks;
  75. unsigned int nbanks;
  76. struct clk *clk;
  77. };
  78. static const struct pinctrl_pin_desc pic32_pins[] = {
  79. PINCTRL_PIN(0, "A0"),
  80. PINCTRL_PIN(1, "A1"),
  81. PINCTRL_PIN(2, "A2"),
  82. PINCTRL_PIN(3, "A3"),
  83. PINCTRL_PIN(4, "A4"),
  84. PINCTRL_PIN(5, "A5"),
  85. PINCTRL_PIN(6, "A6"),
  86. PINCTRL_PIN(7, "A7"),
  87. PINCTRL_PIN(8, "A8"),
  88. PINCTRL_PIN(9, "A9"),
  89. PINCTRL_PIN(10, "A10"),
  90. PINCTRL_PIN(11, "A11"),
  91. PINCTRL_PIN(12, "A12"),
  92. PINCTRL_PIN(13, "A13"),
  93. PINCTRL_PIN(14, "A14"),
  94. PINCTRL_PIN(15, "A15"),
  95. PINCTRL_PIN(16, "B0"),
  96. PINCTRL_PIN(17, "B1"),
  97. PINCTRL_PIN(18, "B2"),
  98. PINCTRL_PIN(19, "B3"),
  99. PINCTRL_PIN(20, "B4"),
  100. PINCTRL_PIN(21, "B5"),
  101. PINCTRL_PIN(22, "B6"),
  102. PINCTRL_PIN(23, "B7"),
  103. PINCTRL_PIN(24, "B8"),
  104. PINCTRL_PIN(25, "B9"),
  105. PINCTRL_PIN(26, "B10"),
  106. PINCTRL_PIN(27, "B11"),
  107. PINCTRL_PIN(28, "B12"),
  108. PINCTRL_PIN(29, "B13"),
  109. PINCTRL_PIN(30, "B14"),
  110. PINCTRL_PIN(31, "B15"),
  111. PINCTRL_PIN(33, "C1"),
  112. PINCTRL_PIN(34, "C2"),
  113. PINCTRL_PIN(35, "C3"),
  114. PINCTRL_PIN(36, "C4"),
  115. PINCTRL_PIN(44, "C12"),
  116. PINCTRL_PIN(45, "C13"),
  117. PINCTRL_PIN(46, "C14"),
  118. PINCTRL_PIN(47, "C15"),
  119. PINCTRL_PIN(48, "D0"),
  120. PINCTRL_PIN(49, "D1"),
  121. PINCTRL_PIN(50, "D2"),
  122. PINCTRL_PIN(51, "D3"),
  123. PINCTRL_PIN(52, "D4"),
  124. PINCTRL_PIN(53, "D5"),
  125. PINCTRL_PIN(54, "D6"),
  126. PINCTRL_PIN(55, "D7"),
  127. PINCTRL_PIN(57, "D9"),
  128. PINCTRL_PIN(58, "D10"),
  129. PINCTRL_PIN(59, "D11"),
  130. PINCTRL_PIN(60, "D12"),
  131. PINCTRL_PIN(61, "D13"),
  132. PINCTRL_PIN(62, "D14"),
  133. PINCTRL_PIN(63, "D15"),
  134. PINCTRL_PIN(64, "E0"),
  135. PINCTRL_PIN(65, "E1"),
  136. PINCTRL_PIN(66, "E2"),
  137. PINCTRL_PIN(67, "E3"),
  138. PINCTRL_PIN(68, "E4"),
  139. PINCTRL_PIN(69, "E5"),
  140. PINCTRL_PIN(70, "E6"),
  141. PINCTRL_PIN(71, "E7"),
  142. PINCTRL_PIN(72, "E8"),
  143. PINCTRL_PIN(73, "E9"),
  144. PINCTRL_PIN(80, "F0"),
  145. PINCTRL_PIN(81, "F1"),
  146. PINCTRL_PIN(82, "F2"),
  147. PINCTRL_PIN(83, "F3"),
  148. PINCTRL_PIN(84, "F4"),
  149. PINCTRL_PIN(85, "F5"),
  150. PINCTRL_PIN(88, "F8"),
  151. PINCTRL_PIN(92, "F12"),
  152. PINCTRL_PIN(93, "F13"),
  153. PINCTRL_PIN(96, "G0"),
  154. PINCTRL_PIN(97, "G1"),
  155. PINCTRL_PIN(102, "G6"),
  156. PINCTRL_PIN(103, "G7"),
  157. PINCTRL_PIN(104, "G8"),
  158. PINCTRL_PIN(105, "G9"),
  159. PINCTRL_PIN(108, "G12"),
  160. PINCTRL_PIN(109, "G13"),
  161. PINCTRL_PIN(110, "G14"),
  162. PINCTRL_PIN(111, "G15"),
  163. PINCTRL_PIN(112, "H0"),
  164. PINCTRL_PIN(113, "H1"),
  165. PINCTRL_PIN(114, "H2"),
  166. PINCTRL_PIN(115, "H3"),
  167. PINCTRL_PIN(116, "H4"),
  168. PINCTRL_PIN(117, "H5"),
  169. PINCTRL_PIN(118, "H6"),
  170. PINCTRL_PIN(119, "H7"),
  171. PINCTRL_PIN(120, "H8"),
  172. PINCTRL_PIN(121, "H9"),
  173. PINCTRL_PIN(122, "H10"),
  174. PINCTRL_PIN(123, "H11"),
  175. PINCTRL_PIN(124, "H12"),
  176. PINCTRL_PIN(125, "H13"),
  177. PINCTRL_PIN(126, "H14"),
  178. PINCTRL_PIN(127, "H15"),
  179. PINCTRL_PIN(128, "J0"),
  180. PINCTRL_PIN(129, "J1"),
  181. PINCTRL_PIN(130, "J2"),
  182. PINCTRL_PIN(131, "J3"),
  183. PINCTRL_PIN(132, "J4"),
  184. PINCTRL_PIN(133, "J5"),
  185. PINCTRL_PIN(134, "J6"),
  186. PINCTRL_PIN(135, "J7"),
  187. PINCTRL_PIN(136, "J8"),
  188. PINCTRL_PIN(137, "J9"),
  189. PINCTRL_PIN(138, "J10"),
  190. PINCTRL_PIN(139, "J11"),
  191. PINCTRL_PIN(140, "J12"),
  192. PINCTRL_PIN(141, "J13"),
  193. PINCTRL_PIN(142, "J14"),
  194. PINCTRL_PIN(143, "J15"),
  195. PINCTRL_PIN(144, "K0"),
  196. PINCTRL_PIN(145, "K1"),
  197. PINCTRL_PIN(146, "K2"),
  198. PINCTRL_PIN(147, "K3"),
  199. PINCTRL_PIN(148, "K4"),
  200. PINCTRL_PIN(149, "K5"),
  201. PINCTRL_PIN(150, "K6"),
  202. PINCTRL_PIN(151, "K7"),
  203. };
  204. static const char * const pic32_input0_group[] = {
  205. "D2", "G8", "F4", "F1", "B9", "B10", "C14", "B5",
  206. "C1", "D14", "G1", "A14", "D6",
  207. };
  208. static const char * const pic32_input1_group[] = {
  209. "D3", "G7", "F5", "D11", "F0", "B1", "E5", "C13",
  210. "B3", "C4", "G0", "A15", "D7",
  211. };
  212. static const char * const pic32_input2_group[] = {
  213. "D9", "G6", "B8", "B15", "D4", "B0", "E3", "B7",
  214. "F12", "D12", "F8", "C3", "E9",
  215. };
  216. static const char * const pic32_input3_group[] = {
  217. "G9", "B14", "D0", "B6", "D5", "B2", "F3", "F13",
  218. "F2", "C2", "E8",
  219. };
  220. static const char * const pic32_output0_group[] = {
  221. "D2", "G8", "F4", "D10", "F1", "B9", "B10", "C14",
  222. "B5", "C1", "D14", "G1", "A14", "D6",
  223. };
  224. static const char * const pic32_output0_1_group[] = {
  225. "D2", "G8", "F4", "D10", "F1", "B9", "B10", "C14",
  226. "B5", "C1", "D14", "G1", "A14", "D6",
  227. "D3", "G7", "F5", "D11", "F0", "B1", "E5", "C13",
  228. "B3", "C4", "D15", "G0", "A15", "D7",
  229. };
  230. static const char *const pic32_output1_group[] = {
  231. "D3", "G7", "F5", "D11", "F0", "B1", "E5", "C13",
  232. "B3", "C4", "D15", "G0", "A15", "D7",
  233. };
  234. static const char *const pic32_output1_3_group[] = {
  235. "D3", "G7", "F5", "D11", "F0", "B1", "E5", "C13",
  236. "B3", "C4", "D15", "G0", "A15", "D7",
  237. "G9", "B14", "D0", "B6", "D5", "B2", "F3", "F13",
  238. "C2", "E8", "F2",
  239. };
  240. static const char * const pic32_output2_group[] = {
  241. "D9", "G6", "B8", "B15", "D4", "B0", "E3", "B7",
  242. "F12", "D12", "F8", "C3", "E9",
  243. };
  244. static const char * const pic32_output2_3_group[] = {
  245. "D9", "G6", "B8", "B15", "D4", "B0", "E3", "B7",
  246. "F12", "D12", "F8", "C3", "E9",
  247. "G9", "B14", "D0", "B6", "D5", "B2", "F3", "F13",
  248. "C2", "E8", "F2",
  249. };
  250. static const char * const pic32_output3_group[] = {
  251. "G9", "B14", "D0", "B6", "D5", "B2", "F3", "F13",
  252. "C2", "E8", "F2",
  253. };
  254. #define FUNCTION(_name, _gr) \
  255. { \
  256. .name = #_name, \
  257. .groups = pic32_##_gr##_group, \
  258. .ngroups = ARRAY_SIZE(pic32_##_gr##_group), \
  259. }
  260. static const struct pic32_function pic32_functions[] = {
  261. FUNCTION(INT3, input0),
  262. FUNCTION(T2CK, input0),
  263. FUNCTION(T6CK, input0),
  264. FUNCTION(IC3, input0),
  265. FUNCTION(IC7, input0),
  266. FUNCTION(U1RX, input0),
  267. FUNCTION(U2CTS, input0),
  268. FUNCTION(U5RX, input0),
  269. FUNCTION(U6CTS, input0),
  270. FUNCTION(SDI1, input0),
  271. FUNCTION(SDI3, input0),
  272. FUNCTION(SDI5, input0),
  273. FUNCTION(SS6IN, input0),
  274. FUNCTION(REFCLKI1, input0),
  275. FUNCTION(INT4, input1),
  276. FUNCTION(T5CK, input1),
  277. FUNCTION(T7CK, input1),
  278. FUNCTION(IC4, input1),
  279. FUNCTION(IC8, input1),
  280. FUNCTION(U3RX, input1),
  281. FUNCTION(U4CTS, input1),
  282. FUNCTION(SDI2, input1),
  283. FUNCTION(SDI4, input1),
  284. FUNCTION(C1RX, input1),
  285. FUNCTION(REFCLKI4, input1),
  286. FUNCTION(INT2, input2),
  287. FUNCTION(T3CK, input2),
  288. FUNCTION(T8CK, input2),
  289. FUNCTION(IC2, input2),
  290. FUNCTION(IC5, input2),
  291. FUNCTION(IC9, input2),
  292. FUNCTION(U1CTS, input2),
  293. FUNCTION(U2RX, input2),
  294. FUNCTION(U5CTS, input2),
  295. FUNCTION(SS1IN, input2),
  296. FUNCTION(SS3IN, input2),
  297. FUNCTION(SS4IN, input2),
  298. FUNCTION(SS5IN, input2),
  299. FUNCTION(C2RX, input2),
  300. FUNCTION(INT1, input3),
  301. FUNCTION(T4CK, input3),
  302. FUNCTION(T9CK, input3),
  303. FUNCTION(IC1, input3),
  304. FUNCTION(IC6, input3),
  305. FUNCTION(U3CTS, input3),
  306. FUNCTION(U4RX, input3),
  307. FUNCTION(U6RX, input3),
  308. FUNCTION(SS2IN, input3),
  309. FUNCTION(SDI6, input3),
  310. FUNCTION(OCFA, input3),
  311. FUNCTION(REFCLKI3, input3),
  312. FUNCTION(U3TX, output0),
  313. FUNCTION(U4RTS, output0),
  314. FUNCTION(SDO1, output0_1),
  315. FUNCTION(SDO2, output0_1),
  316. FUNCTION(SDO3, output0_1),
  317. FUNCTION(SDO5, output0_1),
  318. FUNCTION(SS6OUT, output0),
  319. FUNCTION(OC3, output0),
  320. FUNCTION(OC6, output0),
  321. FUNCTION(REFCLKO4, output0),
  322. FUNCTION(C2OUT, output0),
  323. FUNCTION(C1TX, output0),
  324. FUNCTION(U1TX, output1),
  325. FUNCTION(U2RTS, output1),
  326. FUNCTION(U5TX, output1),
  327. FUNCTION(U6RTS, output1),
  328. FUNCTION(SDO4, output1_3),
  329. FUNCTION(OC4, output1),
  330. FUNCTION(OC7, output1),
  331. FUNCTION(REFCLKO1, output1),
  332. FUNCTION(U3RTS, output2),
  333. FUNCTION(U4TX, output2),
  334. FUNCTION(U6TX, output2_3),
  335. FUNCTION(SS1OUT, output2),
  336. FUNCTION(SS3OUT, output2),
  337. FUNCTION(SS4OUT, output2),
  338. FUNCTION(SS5OUT, output2),
  339. FUNCTION(SDO6, output2_3),
  340. FUNCTION(OC5, output2),
  341. FUNCTION(OC8, output2),
  342. FUNCTION(C1OUT, output2),
  343. FUNCTION(REFCLKO3, output2),
  344. FUNCTION(U1RTS, output3),
  345. FUNCTION(U2TX, output3),
  346. FUNCTION(U5RTS, output3),
  347. FUNCTION(SS2OUT, output3),
  348. FUNCTION(OC2, output3),
  349. FUNCTION(OC1, output3),
  350. FUNCTION(OC9, output3),
  351. FUNCTION(C2TX, output3),
  352. };
  353. #define PIC32_PINCTRL_GROUP(_pin, _name, ...) \
  354. { \
  355. .name = #_name, \
  356. .pin = _pin, \
  357. .functions = (struct pic32_desc_function[]){ \
  358. __VA_ARGS__, { } }, \
  359. }
  360. #define PIC32_PINCTRL_FUNCTION(_name, _muxreg, _muxval) \
  361. { \
  362. .name = #_name, \
  363. .muxreg = _muxreg, \
  364. .muxval = _muxval, \
  365. }
  366. static const struct pic32_pin_group pic32_groups[] = {
  367. PIC32_PINCTRL_GROUP(14, A14,
  368. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 13),
  369. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 13),
  370. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 13),
  371. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 13),
  372. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 13),
  373. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 13),
  374. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 13),
  375. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 13),
  376. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 13),
  377. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 13),
  378. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 13),
  379. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 13),
  380. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 13),
  381. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 13),
  382. PIC32_PINCTRL_FUNCTION(U3TX, RPA14R, 1),
  383. PIC32_PINCTRL_FUNCTION(U4RTS, RPA14R, 2),
  384. PIC32_PINCTRL_FUNCTION(SDO1, RPA14R, 5),
  385. PIC32_PINCTRL_FUNCTION(SDO2, RPA14R, 6),
  386. PIC32_PINCTRL_FUNCTION(SDO3, RPA14R, 7),
  387. PIC32_PINCTRL_FUNCTION(SDO5, RPA14R, 9),
  388. PIC32_PINCTRL_FUNCTION(SS6OUT, RPA14R, 10),
  389. PIC32_PINCTRL_FUNCTION(OC3, RPA14R, 11),
  390. PIC32_PINCTRL_FUNCTION(OC6, RPA14R, 12),
  391. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPA14R, 13),
  392. PIC32_PINCTRL_FUNCTION(C2OUT, RPA14R, 14),
  393. PIC32_PINCTRL_FUNCTION(C1TX, RPA14R, 15)),
  394. PIC32_PINCTRL_GROUP(15, A15,
  395. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 13),
  396. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 13),
  397. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 13),
  398. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 13),
  399. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 13),
  400. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 13),
  401. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 13),
  402. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 13),
  403. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 13),
  404. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 13),
  405. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 13),
  406. PIC32_PINCTRL_FUNCTION(U1TX, RPA15R, 1),
  407. PIC32_PINCTRL_FUNCTION(U2RTS, RPA15R, 2),
  408. PIC32_PINCTRL_FUNCTION(U5TX, RPA15R, 3),
  409. PIC32_PINCTRL_FUNCTION(U6RTS, RPA15R, 4),
  410. PIC32_PINCTRL_FUNCTION(SDO1, RPA15R, 5),
  411. PIC32_PINCTRL_FUNCTION(SDO2, RPA15R, 6),
  412. PIC32_PINCTRL_FUNCTION(SDO3, RPA15R, 7),
  413. PIC32_PINCTRL_FUNCTION(SDO4, RPA15R, 8),
  414. PIC32_PINCTRL_FUNCTION(SDO5, RPA15R, 9),
  415. PIC32_PINCTRL_FUNCTION(OC4, RPA15R, 11),
  416. PIC32_PINCTRL_FUNCTION(OC7, RPA15R, 12),
  417. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPA15R, 15)),
  418. PIC32_PINCTRL_GROUP(16, B0,
  419. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 5),
  420. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 5),
  421. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 5),
  422. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 5),
  423. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 5),
  424. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 5),
  425. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 5),
  426. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 5),
  427. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 5),
  428. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 5),
  429. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 5),
  430. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 5),
  431. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 5),
  432. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 5),
  433. PIC32_PINCTRL_FUNCTION(U3RTS, RPB0R, 1),
  434. PIC32_PINCTRL_FUNCTION(U4TX, RPB0R, 2),
  435. PIC32_PINCTRL_FUNCTION(U6TX, RPB0R, 4),
  436. PIC32_PINCTRL_FUNCTION(SS1OUT, RPB0R, 5),
  437. PIC32_PINCTRL_FUNCTION(SS3OUT, RPB0R, 7),
  438. PIC32_PINCTRL_FUNCTION(SS4OUT, RPB0R, 8),
  439. PIC32_PINCTRL_FUNCTION(SS5OUT, RPB0R, 9),
  440. PIC32_PINCTRL_FUNCTION(SDO6, RPB0R, 10),
  441. PIC32_PINCTRL_FUNCTION(OC5, RPB0R, 11),
  442. PIC32_PINCTRL_FUNCTION(OC8, RPB0R, 12),
  443. PIC32_PINCTRL_FUNCTION(C1OUT, RPB0R, 14),
  444. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPB0R, 15)),
  445. PIC32_PINCTRL_GROUP(17, B1,
  446. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 5),
  447. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 5),
  448. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 5),
  449. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 5),
  450. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 5),
  451. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 5),
  452. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 5),
  453. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 5),
  454. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 5),
  455. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 5),
  456. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 5),
  457. PIC32_PINCTRL_FUNCTION(U1TX, RPB1R, 1),
  458. PIC32_PINCTRL_FUNCTION(U2RTS, RPB1R, 2),
  459. PIC32_PINCTRL_FUNCTION(U5TX, RPB1R, 3),
  460. PIC32_PINCTRL_FUNCTION(U6RTS, RPB1R, 4),
  461. PIC32_PINCTRL_FUNCTION(SDO1, RPB1R, 5),
  462. PIC32_PINCTRL_FUNCTION(SDO2, RPB1R, 6),
  463. PIC32_PINCTRL_FUNCTION(SDO3, RPB1R, 7),
  464. PIC32_PINCTRL_FUNCTION(SDO4, RPB1R, 8),
  465. PIC32_PINCTRL_FUNCTION(SDO5, RPB1R, 9),
  466. PIC32_PINCTRL_FUNCTION(OC4, RPB1R, 11),
  467. PIC32_PINCTRL_FUNCTION(OC7, RPB1R, 12),
  468. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPB1R, 15)),
  469. PIC32_PINCTRL_GROUP(18, B2,
  470. PIC32_PINCTRL_FUNCTION(INT1, INT1R, 7),
  471. PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 7),
  472. PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 7),
  473. PIC32_PINCTRL_FUNCTION(IC1, IC1R, 7),
  474. PIC32_PINCTRL_FUNCTION(IC6, IC6R, 7),
  475. PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 7),
  476. PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 7),
  477. PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 7),
  478. PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 7),
  479. PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 7),
  480. PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 7),
  481. PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 7),
  482. PIC32_PINCTRL_FUNCTION(U1RTS, RPB2R, 1),
  483. PIC32_PINCTRL_FUNCTION(U2TX, RPB2R, 2),
  484. PIC32_PINCTRL_FUNCTION(U5RTS, RPB2R, 3),
  485. PIC32_PINCTRL_FUNCTION(U6TX, RPB2R, 4),
  486. PIC32_PINCTRL_FUNCTION(SS2OUT, RPB2R, 6),
  487. PIC32_PINCTRL_FUNCTION(SDO4, RPB2R, 8),
  488. PIC32_PINCTRL_FUNCTION(SDO6, RPB2R, 10),
  489. PIC32_PINCTRL_FUNCTION(OC2, RPB2R, 11),
  490. PIC32_PINCTRL_FUNCTION(OC1, RPB2R, 12),
  491. PIC32_PINCTRL_FUNCTION(OC9, RPB2R, 13),
  492. PIC32_PINCTRL_FUNCTION(C2TX, RPB2R, 15)),
  493. PIC32_PINCTRL_GROUP(19, B3,
  494. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 8),
  495. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 8),
  496. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 8),
  497. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 8),
  498. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 8),
  499. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 8),
  500. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 8),
  501. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 8),
  502. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 8),
  503. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 8),
  504. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 8),
  505. PIC32_PINCTRL_FUNCTION(U1TX, RPB3R, 1),
  506. PIC32_PINCTRL_FUNCTION(U2RTS, RPB3R, 2),
  507. PIC32_PINCTRL_FUNCTION(U5TX, RPB3R, 3),
  508. PIC32_PINCTRL_FUNCTION(U6RTS, RPB3R, 4),
  509. PIC32_PINCTRL_FUNCTION(SDO1, RPB3R, 5),
  510. PIC32_PINCTRL_FUNCTION(SDO2, RPB3R, 6),
  511. PIC32_PINCTRL_FUNCTION(SDO3, RPB3R, 7),
  512. PIC32_PINCTRL_FUNCTION(SDO4, RPB3R, 8),
  513. PIC32_PINCTRL_FUNCTION(SDO5, RPB3R, 9),
  514. PIC32_PINCTRL_FUNCTION(OC4, RPB3R, 11),
  515. PIC32_PINCTRL_FUNCTION(OC7, RPB3R, 12),
  516. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPB3R, 15)),
  517. PIC32_PINCTRL_GROUP(21, B5,
  518. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 8),
  519. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 8),
  520. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 8),
  521. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 8),
  522. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 8),
  523. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 8),
  524. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 8),
  525. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 8),
  526. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 8),
  527. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 8),
  528. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 8),
  529. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 8),
  530. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 8),
  531. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 8),
  532. PIC32_PINCTRL_FUNCTION(U3TX, RPB5R, 1),
  533. PIC32_PINCTRL_FUNCTION(U4RTS, RPB5R, 2),
  534. PIC32_PINCTRL_FUNCTION(SDO1, RPB5R, 5),
  535. PIC32_PINCTRL_FUNCTION(SDO2, RPB5R, 6),
  536. PIC32_PINCTRL_FUNCTION(SDO3, RPB5R, 7),
  537. PIC32_PINCTRL_FUNCTION(SDO5, RPB5R, 9),
  538. PIC32_PINCTRL_FUNCTION(SS6OUT, RPB5R, 10),
  539. PIC32_PINCTRL_FUNCTION(OC3, RPB5R, 11),
  540. PIC32_PINCTRL_FUNCTION(OC6, RPB5R, 12),
  541. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPB5R, 13),
  542. PIC32_PINCTRL_FUNCTION(C2OUT, RPB5R, 14),
  543. PIC32_PINCTRL_FUNCTION(C1TX, RPB5R, 15)),
  544. PIC32_PINCTRL_GROUP(22, B6,
  545. PIC32_PINCTRL_FUNCTION(INT1, INT1R, 4),
  546. PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 4),
  547. PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 4),
  548. PIC32_PINCTRL_FUNCTION(IC1, IC1R, 4),
  549. PIC32_PINCTRL_FUNCTION(IC6, IC6R, 4),
  550. PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 4),
  551. PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 4),
  552. PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 4),
  553. PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 4),
  554. PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 4),
  555. PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 4),
  556. PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 4),
  557. PIC32_PINCTRL_FUNCTION(U1RTS, RPB6R, 1),
  558. PIC32_PINCTRL_FUNCTION(U2TX, RPB6R, 2),
  559. PIC32_PINCTRL_FUNCTION(U5RTS, RPB6R, 3),
  560. PIC32_PINCTRL_FUNCTION(U6TX, RPB6R, 4),
  561. PIC32_PINCTRL_FUNCTION(SS2OUT, RPB6R, 6),
  562. PIC32_PINCTRL_FUNCTION(SDO4, RPB6R, 8),
  563. PIC32_PINCTRL_FUNCTION(SDO6, RPB6R, 10),
  564. PIC32_PINCTRL_FUNCTION(OC2, RPB6R, 11),
  565. PIC32_PINCTRL_FUNCTION(OC1, RPB6R, 12),
  566. PIC32_PINCTRL_FUNCTION(OC9, RPB6R, 13),
  567. PIC32_PINCTRL_FUNCTION(C2TX, RPB6R, 15)),
  568. PIC32_PINCTRL_GROUP(23, B7,
  569. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 7),
  570. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 7),
  571. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 7),
  572. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 7),
  573. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 7),
  574. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 7),
  575. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 7),
  576. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 7),
  577. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 7),
  578. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 7),
  579. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 7),
  580. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 7),
  581. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 7),
  582. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 7),
  583. PIC32_PINCTRL_FUNCTION(U3RTS, RPB7R, 1),
  584. PIC32_PINCTRL_FUNCTION(U4TX, RPB7R, 2),
  585. PIC32_PINCTRL_FUNCTION(U6TX, RPB7R, 4),
  586. PIC32_PINCTRL_FUNCTION(SS1OUT, RPB7R, 5),
  587. PIC32_PINCTRL_FUNCTION(SS3OUT, RPB7R, 7),
  588. PIC32_PINCTRL_FUNCTION(SS4OUT, RPB7R, 8),
  589. PIC32_PINCTRL_FUNCTION(SS5OUT, RPB7R, 9),
  590. PIC32_PINCTRL_FUNCTION(SDO6, RPB7R, 10),
  591. PIC32_PINCTRL_FUNCTION(OC5, RPB7R, 11),
  592. PIC32_PINCTRL_FUNCTION(OC8, RPB7R, 12),
  593. PIC32_PINCTRL_FUNCTION(C1OUT, RPB7R, 14),
  594. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPB7R, 15)),
  595. PIC32_PINCTRL_GROUP(24, B8,
  596. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 2),
  597. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 2),
  598. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 2),
  599. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 2),
  600. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 2),
  601. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 2),
  602. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 2),
  603. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 2),
  604. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 2),
  605. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 2),
  606. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 2),
  607. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 2),
  608. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 2),
  609. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 2),
  610. PIC32_PINCTRL_FUNCTION(U3RTS, RPB8R, 1),
  611. PIC32_PINCTRL_FUNCTION(U4TX, RPB8R, 2),
  612. PIC32_PINCTRL_FUNCTION(U6TX, RPB8R, 4),
  613. PIC32_PINCTRL_FUNCTION(SS1OUT, RPB8R, 5),
  614. PIC32_PINCTRL_FUNCTION(SS3OUT, RPB8R, 7),
  615. PIC32_PINCTRL_FUNCTION(SS4OUT, RPB8R, 8),
  616. PIC32_PINCTRL_FUNCTION(SS5OUT, RPB8R, 9),
  617. PIC32_PINCTRL_FUNCTION(SDO6, RPB8R, 10),
  618. PIC32_PINCTRL_FUNCTION(OC5, RPB8R, 11),
  619. PIC32_PINCTRL_FUNCTION(OC8, RPB8R, 12),
  620. PIC32_PINCTRL_FUNCTION(C1OUT, RPB8R, 14),
  621. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPB8R, 15)),
  622. PIC32_PINCTRL_GROUP(25, B9,
  623. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 5),
  624. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 5),
  625. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 5),
  626. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 5),
  627. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 5),
  628. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 5),
  629. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 5),
  630. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 5),
  631. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 5),
  632. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 5),
  633. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 5),
  634. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 5),
  635. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 5),
  636. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 5),
  637. PIC32_PINCTRL_FUNCTION(U3TX, RPB9R, 1),
  638. PIC32_PINCTRL_FUNCTION(U4RTS, RPB9R, 2),
  639. PIC32_PINCTRL_FUNCTION(SDO1, RPB9R, 5),
  640. PIC32_PINCTRL_FUNCTION(SDO2, RPB9R, 6),
  641. PIC32_PINCTRL_FUNCTION(SDO3, RPB9R, 7),
  642. PIC32_PINCTRL_FUNCTION(SDO5, RPB9R, 9),
  643. PIC32_PINCTRL_FUNCTION(SS6OUT, RPB9R, 10),
  644. PIC32_PINCTRL_FUNCTION(OC3, RPB9R, 11),
  645. PIC32_PINCTRL_FUNCTION(OC6, RPB9R, 12),
  646. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPB9R, 13),
  647. PIC32_PINCTRL_FUNCTION(C2OUT, RPB9R, 14),
  648. PIC32_PINCTRL_FUNCTION(C1TX, RPB9R, 15)),
  649. PIC32_PINCTRL_GROUP(26, B10,
  650. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 6),
  651. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 6),
  652. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 6),
  653. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 6),
  654. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 6),
  655. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 6),
  656. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 6),
  657. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 6),
  658. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 6),
  659. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 6),
  660. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 6),
  661. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 6),
  662. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 6),
  663. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 6),
  664. PIC32_PINCTRL_FUNCTION(U3TX, RPB10R, 1),
  665. PIC32_PINCTRL_FUNCTION(U4RTS, RPB10R, 2),
  666. PIC32_PINCTRL_FUNCTION(SDO1, RPB10R, 5),
  667. PIC32_PINCTRL_FUNCTION(SDO2, RPB10R, 6),
  668. PIC32_PINCTRL_FUNCTION(SDO3, RPB10R, 7),
  669. PIC32_PINCTRL_FUNCTION(SDO5, RPB10R, 9),
  670. PIC32_PINCTRL_FUNCTION(SS6OUT, RPB10R, 10),
  671. PIC32_PINCTRL_FUNCTION(OC3, RPB10R, 11),
  672. PIC32_PINCTRL_FUNCTION(OC6, RPB10R, 12),
  673. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPB10R, 13),
  674. PIC32_PINCTRL_FUNCTION(C2OUT, RPB10R, 14),
  675. PIC32_PINCTRL_FUNCTION(C1TX, RPB10R, 15)),
  676. PIC32_PINCTRL_GROUP(30, B14,
  677. PIC32_PINCTRL_FUNCTION(INT1, INT1R, 2),
  678. PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 2),
  679. PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 2),
  680. PIC32_PINCTRL_FUNCTION(IC1, IC1R, 2),
  681. PIC32_PINCTRL_FUNCTION(IC6, IC6R, 2),
  682. PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 2),
  683. PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 2),
  684. PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 2),
  685. PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 2),
  686. PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 2),
  687. PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 2),
  688. PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 2),
  689. PIC32_PINCTRL_FUNCTION(U1RTS, RPB14R, 1),
  690. PIC32_PINCTRL_FUNCTION(U2TX, RPB14R, 2),
  691. PIC32_PINCTRL_FUNCTION(U5RTS, RPB14R, 3),
  692. PIC32_PINCTRL_FUNCTION(U6TX, RPB14R, 4),
  693. PIC32_PINCTRL_FUNCTION(SS2OUT, RPB14R, 6),
  694. PIC32_PINCTRL_FUNCTION(SDO4, RPB14R, 8),
  695. PIC32_PINCTRL_FUNCTION(SDO6, RPB14R, 10),
  696. PIC32_PINCTRL_FUNCTION(OC2, RPB14R, 11),
  697. PIC32_PINCTRL_FUNCTION(OC1, RPB14R, 12),
  698. PIC32_PINCTRL_FUNCTION(OC9, RPB14R, 13),
  699. PIC32_PINCTRL_FUNCTION(C2TX, RPB14R, 15)),
  700. PIC32_PINCTRL_GROUP(31, B15,
  701. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 3),
  702. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 3),
  703. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 3),
  704. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 3),
  705. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 3),
  706. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 3),
  707. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 3),
  708. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 3),
  709. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 3),
  710. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 3),
  711. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 3),
  712. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 3),
  713. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 3),
  714. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 3),
  715. PIC32_PINCTRL_FUNCTION(U3RTS, RPB15R, 1),
  716. PIC32_PINCTRL_FUNCTION(U4TX, RPB15R, 2),
  717. PIC32_PINCTRL_FUNCTION(U6TX, RPB15R, 4),
  718. PIC32_PINCTRL_FUNCTION(SS1OUT, RPB15R, 5),
  719. PIC32_PINCTRL_FUNCTION(SS3OUT, RPB15R, 7),
  720. PIC32_PINCTRL_FUNCTION(SS4OUT, RPB15R, 8),
  721. PIC32_PINCTRL_FUNCTION(SS5OUT, RPB15R, 9),
  722. PIC32_PINCTRL_FUNCTION(SDO6, RPB15R, 10),
  723. PIC32_PINCTRL_FUNCTION(OC5, RPB15R, 11),
  724. PIC32_PINCTRL_FUNCTION(OC8, RPB15R, 12),
  725. PIC32_PINCTRL_FUNCTION(C1OUT, RPB15R, 14),
  726. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPB15R, 15)),
  727. PIC32_PINCTRL_GROUP(33, C1,
  728. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 10),
  729. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 10),
  730. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 10),
  731. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 10),
  732. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 10),
  733. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 10),
  734. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 10),
  735. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 10),
  736. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 10),
  737. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 10),
  738. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 10),
  739. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 10),
  740. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 10),
  741. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 10),
  742. PIC32_PINCTRL_FUNCTION(U3TX, RPC1R, 1),
  743. PIC32_PINCTRL_FUNCTION(U4RTS, RPC1R, 2),
  744. PIC32_PINCTRL_FUNCTION(SDO1, RPC1R, 5),
  745. PIC32_PINCTRL_FUNCTION(SDO2, RPC1R, 6),
  746. PIC32_PINCTRL_FUNCTION(SDO3, RPC1R, 7),
  747. PIC32_PINCTRL_FUNCTION(SDO5, RPC1R, 9),
  748. PIC32_PINCTRL_FUNCTION(SS6OUT, RPC1R, 10),
  749. PIC32_PINCTRL_FUNCTION(OC3, RPC1R, 11),
  750. PIC32_PINCTRL_FUNCTION(OC6, RPC1R, 12),
  751. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPC1R, 13),
  752. PIC32_PINCTRL_FUNCTION(C2OUT, RPC1R, 14),
  753. PIC32_PINCTRL_FUNCTION(C1TX, RPC1R, 15)),
  754. PIC32_PINCTRL_GROUP(34, C2,
  755. PIC32_PINCTRL_FUNCTION(INT1, INT1R, 12),
  756. PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 12),
  757. PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 12),
  758. PIC32_PINCTRL_FUNCTION(IC1, IC1R, 12),
  759. PIC32_PINCTRL_FUNCTION(IC6, IC6R, 12),
  760. PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 12),
  761. PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 12),
  762. PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 12),
  763. PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 12),
  764. PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 12),
  765. PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 12),
  766. PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 12),
  767. PIC32_PINCTRL_FUNCTION(U1RTS, RPC2R, 1),
  768. PIC32_PINCTRL_FUNCTION(U2TX, RPC2R, 2),
  769. PIC32_PINCTRL_FUNCTION(U5RTS, RPC2R, 3),
  770. PIC32_PINCTRL_FUNCTION(U6TX, RPC2R, 4),
  771. PIC32_PINCTRL_FUNCTION(SS2OUT, RPC2R, 6),
  772. PIC32_PINCTRL_FUNCTION(SDO4, RPC2R, 8),
  773. PIC32_PINCTRL_FUNCTION(SDO6, RPC2R, 10),
  774. PIC32_PINCTRL_FUNCTION(OC2, RPC2R, 11),
  775. PIC32_PINCTRL_FUNCTION(OC1, RPC2R, 12),
  776. PIC32_PINCTRL_FUNCTION(OC9, RPC2R, 13),
  777. PIC32_PINCTRL_FUNCTION(C2TX, RPC2R, 15)),
  778. PIC32_PINCTRL_GROUP(35, C3,
  779. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 12),
  780. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 12),
  781. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 12),
  782. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 12),
  783. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 12),
  784. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 12),
  785. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 12),
  786. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 12),
  787. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 12),
  788. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 12),
  789. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 12),
  790. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 12),
  791. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 12),
  792. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 12),
  793. PIC32_PINCTRL_FUNCTION(U3RTS, RPC3R, 1),
  794. PIC32_PINCTRL_FUNCTION(U4TX, RPC3R, 2),
  795. PIC32_PINCTRL_FUNCTION(U6TX, RPC3R, 4),
  796. PIC32_PINCTRL_FUNCTION(SS1OUT, RPC3R, 5),
  797. PIC32_PINCTRL_FUNCTION(SS3OUT, RPC3R, 7),
  798. PIC32_PINCTRL_FUNCTION(SS4OUT, RPC3R, 8),
  799. PIC32_PINCTRL_FUNCTION(SS5OUT, RPC3R, 9),
  800. PIC32_PINCTRL_FUNCTION(SDO6, RPC3R, 10),
  801. PIC32_PINCTRL_FUNCTION(OC5, RPC3R, 11),
  802. PIC32_PINCTRL_FUNCTION(OC8, RPC3R, 12),
  803. PIC32_PINCTRL_FUNCTION(C1OUT, RPC3R, 14),
  804. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPC3R, 15)),
  805. PIC32_PINCTRL_GROUP(36, C4,
  806. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 10),
  807. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 10),
  808. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 10),
  809. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 10),
  810. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 10),
  811. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 10),
  812. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 10),
  813. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 10),
  814. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 10),
  815. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 10),
  816. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 10),
  817. PIC32_PINCTRL_FUNCTION(U1TX, RPC4R, 1),
  818. PIC32_PINCTRL_FUNCTION(U2RTS, RPC4R, 2),
  819. PIC32_PINCTRL_FUNCTION(U5TX, RPC4R, 3),
  820. PIC32_PINCTRL_FUNCTION(U6RTS, RPC4R, 4),
  821. PIC32_PINCTRL_FUNCTION(SDO1, RPC4R, 5),
  822. PIC32_PINCTRL_FUNCTION(SDO2, RPC4R, 6),
  823. PIC32_PINCTRL_FUNCTION(SDO3, RPC4R, 7),
  824. PIC32_PINCTRL_FUNCTION(SDO4, RPC4R, 8),
  825. PIC32_PINCTRL_FUNCTION(SDO5, RPC4R, 9),
  826. PIC32_PINCTRL_FUNCTION(OC4, RPC4R, 11),
  827. PIC32_PINCTRL_FUNCTION(OC7, RPC4R, 12),
  828. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPC4R, 15)),
  829. PIC32_PINCTRL_GROUP(45, C13,
  830. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 7),
  831. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 7),
  832. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 7),
  833. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 7),
  834. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 7),
  835. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 7),
  836. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 7),
  837. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 7),
  838. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 7),
  839. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 7),
  840. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 7),
  841. PIC32_PINCTRL_FUNCTION(U1TX, RPC13R, 1),
  842. PIC32_PINCTRL_FUNCTION(U2RTS, RPC13R, 2),
  843. PIC32_PINCTRL_FUNCTION(U5TX, RPC13R, 3),
  844. PIC32_PINCTRL_FUNCTION(U6RTS, RPC13R, 4),
  845. PIC32_PINCTRL_FUNCTION(SDO1, RPC13R, 5),
  846. PIC32_PINCTRL_FUNCTION(SDO2, RPC13R, 6),
  847. PIC32_PINCTRL_FUNCTION(SDO3, RPC13R, 7),
  848. PIC32_PINCTRL_FUNCTION(SDO4, RPC13R, 8),
  849. PIC32_PINCTRL_FUNCTION(SDO5, RPC13R, 9),
  850. PIC32_PINCTRL_FUNCTION(OC4, RPC13R, 11),
  851. PIC32_PINCTRL_FUNCTION(OC7, RPC13R, 12),
  852. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPC13R, 15)),
  853. PIC32_PINCTRL_GROUP(46, C14,
  854. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 7),
  855. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 7),
  856. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 7),
  857. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 7),
  858. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 7),
  859. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 7),
  860. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 7),
  861. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 7),
  862. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 7),
  863. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 7),
  864. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 7),
  865. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 7),
  866. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 7),
  867. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 7),
  868. PIC32_PINCTRL_FUNCTION(U3TX, RPC14R, 1),
  869. PIC32_PINCTRL_FUNCTION(U4RTS, RPC14R, 2),
  870. PIC32_PINCTRL_FUNCTION(SDO1, RPC14R, 5),
  871. PIC32_PINCTRL_FUNCTION(SDO2, RPC14R, 6),
  872. PIC32_PINCTRL_FUNCTION(SDO3, RPC14R, 7),
  873. PIC32_PINCTRL_FUNCTION(SDO5, RPC14R, 9),
  874. PIC32_PINCTRL_FUNCTION(SS6OUT, RPC14R, 10),
  875. PIC32_PINCTRL_FUNCTION(OC3, RPC14R, 11),
  876. PIC32_PINCTRL_FUNCTION(OC6, RPC14R, 12),
  877. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPC14R, 13),
  878. PIC32_PINCTRL_FUNCTION(C2OUT, RPC14R, 14),
  879. PIC32_PINCTRL_FUNCTION(C1TX, RPC14R, 15)),
  880. PIC32_PINCTRL_GROUP(48, D0,
  881. PIC32_PINCTRL_FUNCTION(INT1, INT1R, 3),
  882. PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 3),
  883. PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 3),
  884. PIC32_PINCTRL_FUNCTION(IC1, IC1R, 3),
  885. PIC32_PINCTRL_FUNCTION(IC6, IC6R, 3),
  886. PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 3),
  887. PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 3),
  888. PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 3),
  889. PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 3),
  890. PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 3),
  891. PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 3),
  892. PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 3),
  893. PIC32_PINCTRL_FUNCTION(U1RTS, RPD0R, 1),
  894. PIC32_PINCTRL_FUNCTION(U2TX, RPD0R, 2),
  895. PIC32_PINCTRL_FUNCTION(U5RTS, RPD0R, 3),
  896. PIC32_PINCTRL_FUNCTION(U6TX, RPD0R, 4),
  897. PIC32_PINCTRL_FUNCTION(SS2OUT, RPD0R, 6),
  898. PIC32_PINCTRL_FUNCTION(SDO4, RPD0R, 8),
  899. PIC32_PINCTRL_FUNCTION(SDO6, RPD0R, 10),
  900. PIC32_PINCTRL_FUNCTION(OC2, RPD0R, 11),
  901. PIC32_PINCTRL_FUNCTION(OC1, RPD0R, 12),
  902. PIC32_PINCTRL_FUNCTION(OC9, RPD0R, 13),
  903. PIC32_PINCTRL_FUNCTION(C2TX, RPD0R, 15)),
  904. PIC32_PINCTRL_GROUP(50, D2,
  905. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 0),
  906. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 0),
  907. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 0),
  908. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 0),
  909. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 0),
  910. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 0),
  911. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 0),
  912. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 0),
  913. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 0),
  914. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 0),
  915. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 0),
  916. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 0),
  917. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 0),
  918. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 0),
  919. PIC32_PINCTRL_FUNCTION(U3TX, RPD2R, 1),
  920. PIC32_PINCTRL_FUNCTION(U4RTS, RPD2R, 2),
  921. PIC32_PINCTRL_FUNCTION(SDO1, RPD2R, 5),
  922. PIC32_PINCTRL_FUNCTION(SDO2, RPD2R, 6),
  923. PIC32_PINCTRL_FUNCTION(SDO3, RPD2R, 7),
  924. PIC32_PINCTRL_FUNCTION(SDO5, RPD2R, 9),
  925. PIC32_PINCTRL_FUNCTION(SS6OUT, RPD2R, 10),
  926. PIC32_PINCTRL_FUNCTION(OC3, RPD2R, 11),
  927. PIC32_PINCTRL_FUNCTION(OC6, RPD2R, 12),
  928. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPD2R, 13),
  929. PIC32_PINCTRL_FUNCTION(C2OUT, RPD2R, 14),
  930. PIC32_PINCTRL_FUNCTION(C1TX, RPD2R, 15)),
  931. PIC32_PINCTRL_GROUP(51, D3,
  932. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 0),
  933. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 0),
  934. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 0),
  935. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 0),
  936. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 0),
  937. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 0),
  938. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 0),
  939. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 0),
  940. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 0),
  941. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 0),
  942. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 0),
  943. PIC32_PINCTRL_FUNCTION(U1TX, RPD3R, 1),
  944. PIC32_PINCTRL_FUNCTION(U2RTS, RPD3R, 2),
  945. PIC32_PINCTRL_FUNCTION(U5TX, RPD3R, 3),
  946. PIC32_PINCTRL_FUNCTION(U6RTS, RPD3R, 4),
  947. PIC32_PINCTRL_FUNCTION(SDO1, RPD3R, 5),
  948. PIC32_PINCTRL_FUNCTION(SDO2, RPD3R, 6),
  949. PIC32_PINCTRL_FUNCTION(SDO3, RPD3R, 7),
  950. PIC32_PINCTRL_FUNCTION(SDO4, RPD3R, 8),
  951. PIC32_PINCTRL_FUNCTION(SDO5, RPD3R, 9),
  952. PIC32_PINCTRL_FUNCTION(OC4, RPD3R, 11),
  953. PIC32_PINCTRL_FUNCTION(OC7, RPD3R, 12),
  954. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPD3R, 15)),
  955. PIC32_PINCTRL_GROUP(52, D4,
  956. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 4),
  957. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 4),
  958. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 4),
  959. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 4),
  960. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 4),
  961. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 4),
  962. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 4),
  963. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 4),
  964. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 4),
  965. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 4),
  966. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 4),
  967. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 4),
  968. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 4),
  969. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 4),
  970. PIC32_PINCTRL_FUNCTION(U3RTS, RPD4R, 1),
  971. PIC32_PINCTRL_FUNCTION(U4TX, RPD4R, 2),
  972. PIC32_PINCTRL_FUNCTION(U6TX, RPD4R, 4),
  973. PIC32_PINCTRL_FUNCTION(SS1OUT, RPD4R, 5),
  974. PIC32_PINCTRL_FUNCTION(SS3OUT, RPD4R, 7),
  975. PIC32_PINCTRL_FUNCTION(SS4OUT, RPD4R, 8),
  976. PIC32_PINCTRL_FUNCTION(SS5OUT, RPD4R, 9),
  977. PIC32_PINCTRL_FUNCTION(SDO6, RPD4R, 10),
  978. PIC32_PINCTRL_FUNCTION(OC5, RPD4R, 11),
  979. PIC32_PINCTRL_FUNCTION(OC8, RPD4R, 12),
  980. PIC32_PINCTRL_FUNCTION(C1OUT, RPD4R, 14),
  981. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPD4R, 15)),
  982. PIC32_PINCTRL_GROUP(53, D5,
  983. PIC32_PINCTRL_FUNCTION(INT1, INT1R, 6),
  984. PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 6),
  985. PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 6),
  986. PIC32_PINCTRL_FUNCTION(IC1, IC1R, 6),
  987. PIC32_PINCTRL_FUNCTION(IC6, IC6R, 6),
  988. PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 6),
  989. PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 6),
  990. PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 6),
  991. PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 6),
  992. PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 6),
  993. PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 6),
  994. PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 6),
  995. PIC32_PINCTRL_FUNCTION(U1RTS, RPD5R, 1),
  996. PIC32_PINCTRL_FUNCTION(U2TX, RPD5R, 2),
  997. PIC32_PINCTRL_FUNCTION(U5RTS, RPD5R, 3),
  998. PIC32_PINCTRL_FUNCTION(U6TX, RPD5R, 4),
  999. PIC32_PINCTRL_FUNCTION(SS2OUT, RPD5R, 6),
  1000. PIC32_PINCTRL_FUNCTION(SDO4, RPD5R, 8),
  1001. PIC32_PINCTRL_FUNCTION(SDO6, RPD5R, 10),
  1002. PIC32_PINCTRL_FUNCTION(OC2, RPD5R, 11),
  1003. PIC32_PINCTRL_FUNCTION(OC1, RPD5R, 12),
  1004. PIC32_PINCTRL_FUNCTION(OC9, RPD5R, 13),
  1005. PIC32_PINCTRL_FUNCTION(C2TX, RPD5R, 15)),
  1006. PIC32_PINCTRL_GROUP(54, D6,
  1007. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 14),
  1008. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 14),
  1009. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 14),
  1010. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 14),
  1011. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 14),
  1012. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 14),
  1013. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 14),
  1014. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 14),
  1015. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 14),
  1016. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 14),
  1017. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 14),
  1018. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 14),
  1019. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 14),
  1020. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 14),
  1021. PIC32_PINCTRL_FUNCTION(U3TX, RPD6R, 1),
  1022. PIC32_PINCTRL_FUNCTION(U4RTS, RPD6R, 2),
  1023. PIC32_PINCTRL_FUNCTION(SDO1, RPD6R, 5),
  1024. PIC32_PINCTRL_FUNCTION(SDO2, RPD6R, 6),
  1025. PIC32_PINCTRL_FUNCTION(SDO3, RPD6R, 7),
  1026. PIC32_PINCTRL_FUNCTION(SDO5, RPD6R, 9),
  1027. PIC32_PINCTRL_FUNCTION(SS6OUT, RPD6R, 10),
  1028. PIC32_PINCTRL_FUNCTION(OC3, RPD6R, 11),
  1029. PIC32_PINCTRL_FUNCTION(OC6, RPD6R, 12),
  1030. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPD6R, 13),
  1031. PIC32_PINCTRL_FUNCTION(C2OUT, RPD6R, 14),
  1032. PIC32_PINCTRL_FUNCTION(C1TX, RPD6R, 15)),
  1033. PIC32_PINCTRL_GROUP(55, D7,
  1034. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 14),
  1035. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 14),
  1036. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 14),
  1037. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 14),
  1038. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 14),
  1039. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 14),
  1040. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 14),
  1041. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 14),
  1042. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 14),
  1043. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 14),
  1044. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 14),
  1045. PIC32_PINCTRL_FUNCTION(U1TX, RPD7R, 1),
  1046. PIC32_PINCTRL_FUNCTION(U2RTS, RPD7R, 2),
  1047. PIC32_PINCTRL_FUNCTION(U5TX, RPD7R, 3),
  1048. PIC32_PINCTRL_FUNCTION(U6RTS, RPD7R, 4),
  1049. PIC32_PINCTRL_FUNCTION(SDO1, RPD7R, 5),
  1050. PIC32_PINCTRL_FUNCTION(SDO2, RPD7R, 6),
  1051. PIC32_PINCTRL_FUNCTION(SDO3, RPD7R, 7),
  1052. PIC32_PINCTRL_FUNCTION(SDO4, RPD7R, 8),
  1053. PIC32_PINCTRL_FUNCTION(SDO5, RPD7R, 9),
  1054. PIC32_PINCTRL_FUNCTION(OC4, RPD7R, 11),
  1055. PIC32_PINCTRL_FUNCTION(OC7, RPD7R, 12),
  1056. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPD7R, 15)),
  1057. PIC32_PINCTRL_GROUP(57, D9,
  1058. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 0),
  1059. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 0),
  1060. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 0),
  1061. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 0),
  1062. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 0),
  1063. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 0),
  1064. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 0),
  1065. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 0),
  1066. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 0),
  1067. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 0),
  1068. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 0),
  1069. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 0),
  1070. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 0),
  1071. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 0),
  1072. PIC32_PINCTRL_FUNCTION(U3RTS, RPD9R, 1),
  1073. PIC32_PINCTRL_FUNCTION(U4TX, RPD9R, 2),
  1074. PIC32_PINCTRL_FUNCTION(U6TX, RPD9R, 4),
  1075. PIC32_PINCTRL_FUNCTION(SS1OUT, RPD9R, 5),
  1076. PIC32_PINCTRL_FUNCTION(SS3OUT, RPD9R, 7),
  1077. PIC32_PINCTRL_FUNCTION(SS4OUT, RPD9R, 8),
  1078. PIC32_PINCTRL_FUNCTION(SS5OUT, RPD9R, 9),
  1079. PIC32_PINCTRL_FUNCTION(SDO6, RPD9R, 10),
  1080. PIC32_PINCTRL_FUNCTION(OC5, RPD9R, 11),
  1081. PIC32_PINCTRL_FUNCTION(OC8, RPD9R, 12),
  1082. PIC32_PINCTRL_FUNCTION(C1OUT, RPD9R, 14),
  1083. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPD9R, 15)),
  1084. PIC32_PINCTRL_GROUP(58, D10,
  1085. PIC32_PINCTRL_FUNCTION(U3TX, RPD10R, 1),
  1086. PIC32_PINCTRL_FUNCTION(U4RTS, RPD10R, 2),
  1087. PIC32_PINCTRL_FUNCTION(SDO1, RPD10R, 5),
  1088. PIC32_PINCTRL_FUNCTION(SDO2, RPD10R, 6),
  1089. PIC32_PINCTRL_FUNCTION(SDO3, RPD10R, 7),
  1090. PIC32_PINCTRL_FUNCTION(SDO5, RPD10R, 9),
  1091. PIC32_PINCTRL_FUNCTION(SS6OUT, RPD10R, 10),
  1092. PIC32_PINCTRL_FUNCTION(OC3, RPD10R, 11),
  1093. PIC32_PINCTRL_FUNCTION(OC6, RPD10R, 12),
  1094. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPD10R, 13),
  1095. PIC32_PINCTRL_FUNCTION(C2OUT, RPD10R, 14),
  1096. PIC32_PINCTRL_FUNCTION(C1TX, RPD10R, 15)),
  1097. PIC32_PINCTRL_GROUP(59, D11,
  1098. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 3),
  1099. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 3),
  1100. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 3),
  1101. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 3),
  1102. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 3),
  1103. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 3),
  1104. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 3),
  1105. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 3),
  1106. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 3),
  1107. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 3),
  1108. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 3),
  1109. PIC32_PINCTRL_FUNCTION(U1TX, RPD11R, 1),
  1110. PIC32_PINCTRL_FUNCTION(U2RTS, RPD11R, 2),
  1111. PIC32_PINCTRL_FUNCTION(U5TX, RPD11R, 3),
  1112. PIC32_PINCTRL_FUNCTION(U6RTS, RPD11R, 4),
  1113. PIC32_PINCTRL_FUNCTION(SDO1, RPD11R, 5),
  1114. PIC32_PINCTRL_FUNCTION(SDO2, RPD11R, 6),
  1115. PIC32_PINCTRL_FUNCTION(SDO3, RPD11R, 7),
  1116. PIC32_PINCTRL_FUNCTION(SDO4, RPD11R, 8),
  1117. PIC32_PINCTRL_FUNCTION(SDO5, RPD11R, 9),
  1118. PIC32_PINCTRL_FUNCTION(OC4, RPD11R, 11),
  1119. PIC32_PINCTRL_FUNCTION(OC7, RPD11R, 12),
  1120. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPD11R, 15)),
  1121. PIC32_PINCTRL_GROUP(60, D12,
  1122. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 10),
  1123. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 10),
  1124. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 10),
  1125. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 10),
  1126. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 10),
  1127. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 10),
  1128. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 10),
  1129. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 10),
  1130. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 10),
  1131. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 10),
  1132. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 10),
  1133. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 10),
  1134. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 10),
  1135. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 10),
  1136. PIC32_PINCTRL_FUNCTION(U3RTS, RPD12R, 1),
  1137. PIC32_PINCTRL_FUNCTION(U4TX, RPD12R, 2),
  1138. PIC32_PINCTRL_FUNCTION(U6TX, RPD12R, 4),
  1139. PIC32_PINCTRL_FUNCTION(SS1OUT, RPD12R, 5),
  1140. PIC32_PINCTRL_FUNCTION(SS3OUT, RPD12R, 7),
  1141. PIC32_PINCTRL_FUNCTION(SS4OUT, RPD12R, 8),
  1142. PIC32_PINCTRL_FUNCTION(SS5OUT, RPD12R, 9),
  1143. PIC32_PINCTRL_FUNCTION(SDO6, RPD12R, 10),
  1144. PIC32_PINCTRL_FUNCTION(OC5, RPD12R, 11),
  1145. PIC32_PINCTRL_FUNCTION(OC8, RPD12R, 12),
  1146. PIC32_PINCTRL_FUNCTION(C1OUT, RPD12R, 14),
  1147. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPD12R, 15)),
  1148. PIC32_PINCTRL_GROUP(62, D14,
  1149. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 11),
  1150. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 11),
  1151. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 11),
  1152. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 11),
  1153. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 11),
  1154. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 11),
  1155. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 11),
  1156. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 11),
  1157. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 11),
  1158. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 11),
  1159. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 11),
  1160. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 11),
  1161. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 11),
  1162. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 11),
  1163. PIC32_PINCTRL_FUNCTION(U3TX, RPD14R, 1),
  1164. PIC32_PINCTRL_FUNCTION(U4RTS, RPD14R, 2),
  1165. PIC32_PINCTRL_FUNCTION(SDO1, RPD14R, 5),
  1166. PIC32_PINCTRL_FUNCTION(SDO2, RPD14R, 6),
  1167. PIC32_PINCTRL_FUNCTION(SDO3, RPD14R, 7),
  1168. PIC32_PINCTRL_FUNCTION(SDO5, RPD14R, 9),
  1169. PIC32_PINCTRL_FUNCTION(SS6OUT, RPD14R, 10),
  1170. PIC32_PINCTRL_FUNCTION(OC3, RPD14R, 11),
  1171. PIC32_PINCTRL_FUNCTION(OC6, RPD14R, 12),
  1172. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPD14R, 13),
  1173. PIC32_PINCTRL_FUNCTION(C2OUT, RPD14R, 14),
  1174. PIC32_PINCTRL_FUNCTION(C1TX, RPD14R, 15)),
  1175. PIC32_PINCTRL_GROUP(63, D15,
  1176. PIC32_PINCTRL_FUNCTION(U1TX, RPD15R, 1),
  1177. PIC32_PINCTRL_FUNCTION(U2RTS, RPD15R, 2),
  1178. PIC32_PINCTRL_FUNCTION(U5TX, RPD15R, 3),
  1179. PIC32_PINCTRL_FUNCTION(U6RTS, RPD15R, 4),
  1180. PIC32_PINCTRL_FUNCTION(SDO1, RPD15R, 5),
  1181. PIC32_PINCTRL_FUNCTION(SDO2, RPD15R, 6),
  1182. PIC32_PINCTRL_FUNCTION(SDO3, RPD15R, 7),
  1183. PIC32_PINCTRL_FUNCTION(SDO4, RPD15R, 8),
  1184. PIC32_PINCTRL_FUNCTION(SDO5, RPD15R, 9),
  1185. PIC32_PINCTRL_FUNCTION(OC4, RPD15R, 11),
  1186. PIC32_PINCTRL_FUNCTION(OC7, RPD15R, 12),
  1187. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPD15R, 15)),
  1188. PIC32_PINCTRL_GROUP(67, E3,
  1189. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 6),
  1190. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 6),
  1191. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 6),
  1192. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 6),
  1193. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 6),
  1194. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 6),
  1195. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 6),
  1196. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 6),
  1197. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 6),
  1198. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 6),
  1199. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 6),
  1200. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 6),
  1201. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 6),
  1202. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 6),
  1203. PIC32_PINCTRL_FUNCTION(U3RTS, RPE3R, 1),
  1204. PIC32_PINCTRL_FUNCTION(U4TX, RPE3R, 2),
  1205. PIC32_PINCTRL_FUNCTION(U6TX, RPE3R, 4),
  1206. PIC32_PINCTRL_FUNCTION(SS1OUT, RPE3R, 5),
  1207. PIC32_PINCTRL_FUNCTION(SS3OUT, RPE3R, 7),
  1208. PIC32_PINCTRL_FUNCTION(SS4OUT, RPE3R, 8),
  1209. PIC32_PINCTRL_FUNCTION(SS5OUT, RPE3R, 9),
  1210. PIC32_PINCTRL_FUNCTION(SDO6, RPE3R, 10),
  1211. PIC32_PINCTRL_FUNCTION(OC5, RPE3R, 11),
  1212. PIC32_PINCTRL_FUNCTION(OC8, RPE3R, 12),
  1213. PIC32_PINCTRL_FUNCTION(C1OUT, RPE3R, 14),
  1214. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPE3R, 15)),
  1215. PIC32_PINCTRL_GROUP(69, E5,
  1216. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 6),
  1217. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 6),
  1218. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 6),
  1219. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 6),
  1220. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 6),
  1221. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 6),
  1222. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 6),
  1223. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 6),
  1224. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 6),
  1225. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 6),
  1226. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 6),
  1227. PIC32_PINCTRL_FUNCTION(U1TX, RPE5R, 1),
  1228. PIC32_PINCTRL_FUNCTION(U2RTS, RPE5R, 2),
  1229. PIC32_PINCTRL_FUNCTION(U5TX, RPE5R, 3),
  1230. PIC32_PINCTRL_FUNCTION(U6RTS, RPE5R, 4),
  1231. PIC32_PINCTRL_FUNCTION(SDO1, RPE5R, 5),
  1232. PIC32_PINCTRL_FUNCTION(SDO2, RPE5R, 6),
  1233. PIC32_PINCTRL_FUNCTION(SDO3, RPE5R, 7),
  1234. PIC32_PINCTRL_FUNCTION(SDO4, RPE5R, 8),
  1235. PIC32_PINCTRL_FUNCTION(SDO5, RPE5R, 9),
  1236. PIC32_PINCTRL_FUNCTION(OC4, RPE5R, 11),
  1237. PIC32_PINCTRL_FUNCTION(OC7, RPE5R, 12),
  1238. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPE5R, 15)),
  1239. PIC32_PINCTRL_GROUP(72, E8,
  1240. PIC32_PINCTRL_FUNCTION(INT1, INT1R, 13),
  1241. PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 13),
  1242. PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 13),
  1243. PIC32_PINCTRL_FUNCTION(IC1, IC1R, 13),
  1244. PIC32_PINCTRL_FUNCTION(IC6, IC6R, 13),
  1245. PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 13),
  1246. PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 13),
  1247. PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 13),
  1248. PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 13),
  1249. PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 13),
  1250. PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 13),
  1251. PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 13),
  1252. PIC32_PINCTRL_FUNCTION(U1RTS, RPE8R, 1),
  1253. PIC32_PINCTRL_FUNCTION(U2TX, RPE8R, 2),
  1254. PIC32_PINCTRL_FUNCTION(U5RTS, RPE8R, 3),
  1255. PIC32_PINCTRL_FUNCTION(U6TX, RPE8R, 4),
  1256. PIC32_PINCTRL_FUNCTION(SS2OUT, RPE8R, 6),
  1257. PIC32_PINCTRL_FUNCTION(SDO4, RPE8R, 8),
  1258. PIC32_PINCTRL_FUNCTION(SDO6, RPE8R, 10),
  1259. PIC32_PINCTRL_FUNCTION(OC2, RPE8R, 11),
  1260. PIC32_PINCTRL_FUNCTION(OC1, RPE8R, 12),
  1261. PIC32_PINCTRL_FUNCTION(OC9, RPE8R, 13),
  1262. PIC32_PINCTRL_FUNCTION(C2TX, RPE8R, 15)),
  1263. PIC32_PINCTRL_GROUP(73, E9,
  1264. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 13),
  1265. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 13),
  1266. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 13),
  1267. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 13),
  1268. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 13),
  1269. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 13),
  1270. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 13),
  1271. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 13),
  1272. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 13),
  1273. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 13),
  1274. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 13),
  1275. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 13),
  1276. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 13),
  1277. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 13),
  1278. PIC32_PINCTRL_FUNCTION(U3RTS, RPE9R, 1),
  1279. PIC32_PINCTRL_FUNCTION(U4TX, RPE9R, 2),
  1280. PIC32_PINCTRL_FUNCTION(U6TX, RPE9R, 4),
  1281. PIC32_PINCTRL_FUNCTION(SS1OUT, RPE9R, 5),
  1282. PIC32_PINCTRL_FUNCTION(SS3OUT, RPE9R, 7),
  1283. PIC32_PINCTRL_FUNCTION(SS4OUT, RPE9R, 8),
  1284. PIC32_PINCTRL_FUNCTION(SS5OUT, RPE9R, 9),
  1285. PIC32_PINCTRL_FUNCTION(SDO6, RPE9R, 10),
  1286. PIC32_PINCTRL_FUNCTION(OC5, RPE9R, 11),
  1287. PIC32_PINCTRL_FUNCTION(OC8, RPE9R, 12),
  1288. PIC32_PINCTRL_FUNCTION(C1OUT, RPE9R, 14),
  1289. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPE9R, 15)),
  1290. PIC32_PINCTRL_GROUP(80, F0,
  1291. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 4),
  1292. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 4),
  1293. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 4),
  1294. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 4),
  1295. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 4),
  1296. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 4),
  1297. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 4),
  1298. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 4),
  1299. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 4),
  1300. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 4),
  1301. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 4),
  1302. PIC32_PINCTRL_FUNCTION(U1TX, RPF0R, 1),
  1303. PIC32_PINCTRL_FUNCTION(U2RTS, RPF0R, 2),
  1304. PIC32_PINCTRL_FUNCTION(U5TX, RPF0R, 3),
  1305. PIC32_PINCTRL_FUNCTION(U6RTS, RPF0R, 4),
  1306. PIC32_PINCTRL_FUNCTION(SDO1, RPF0R, 5),
  1307. PIC32_PINCTRL_FUNCTION(SDO2, RPF0R, 6),
  1308. PIC32_PINCTRL_FUNCTION(SDO3, RPF0R, 7),
  1309. PIC32_PINCTRL_FUNCTION(SDO4, RPF0R, 8),
  1310. PIC32_PINCTRL_FUNCTION(SDO5, RPF0R, 9),
  1311. PIC32_PINCTRL_FUNCTION(OC4, RPF0R, 11),
  1312. PIC32_PINCTRL_FUNCTION(OC7, RPF0R, 12),
  1313. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPF0R, 15)),
  1314. PIC32_PINCTRL_GROUP(81, F1,
  1315. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 4),
  1316. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 4),
  1317. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 4),
  1318. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 4),
  1319. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 4),
  1320. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 4),
  1321. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 4),
  1322. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 4),
  1323. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 4),
  1324. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 4),
  1325. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 4),
  1326. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 4),
  1327. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 4),
  1328. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 4),
  1329. PIC32_PINCTRL_FUNCTION(U3TX, RPF1R, 1),
  1330. PIC32_PINCTRL_FUNCTION(U4RTS, RPF1R, 2),
  1331. PIC32_PINCTRL_FUNCTION(SDO1, RPF1R, 5),
  1332. PIC32_PINCTRL_FUNCTION(SDO2, RPF1R, 6),
  1333. PIC32_PINCTRL_FUNCTION(SDO3, RPF1R, 7),
  1334. PIC32_PINCTRL_FUNCTION(SDO5, RPF1R, 9),
  1335. PIC32_PINCTRL_FUNCTION(SS6OUT, RPF1R, 10),
  1336. PIC32_PINCTRL_FUNCTION(OC3, RPF1R, 11),
  1337. PIC32_PINCTRL_FUNCTION(OC6, RPF1R, 12),
  1338. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPF1R, 13),
  1339. PIC32_PINCTRL_FUNCTION(C2OUT, RPF1R, 14),
  1340. PIC32_PINCTRL_FUNCTION(C1TX, RPF1R, 15)),
  1341. PIC32_PINCTRL_GROUP(82, F2,
  1342. PIC32_PINCTRL_FUNCTION(INT1, INT1R, 11),
  1343. PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 11),
  1344. PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 11),
  1345. PIC32_PINCTRL_FUNCTION(IC1, IC1R, 11),
  1346. PIC32_PINCTRL_FUNCTION(IC6, IC6R, 11),
  1347. PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 11),
  1348. PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 11),
  1349. PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 11),
  1350. PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 11),
  1351. PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 11),
  1352. PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 11),
  1353. PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 11),
  1354. PIC32_PINCTRL_FUNCTION(U1RTS, RPF2R, 1),
  1355. PIC32_PINCTRL_FUNCTION(U2TX, RPF2R, 2),
  1356. PIC32_PINCTRL_FUNCTION(U5RTS, RPF2R, 3),
  1357. PIC32_PINCTRL_FUNCTION(U6TX, RPF2R, 4),
  1358. PIC32_PINCTRL_FUNCTION(SS2OUT, RPF2R, 6),
  1359. PIC32_PINCTRL_FUNCTION(SDO4, RPF2R, 8),
  1360. PIC32_PINCTRL_FUNCTION(SDO6, RPF2R, 10),
  1361. PIC32_PINCTRL_FUNCTION(OC2, RPF2R, 11),
  1362. PIC32_PINCTRL_FUNCTION(OC1, RPF2R, 12),
  1363. PIC32_PINCTRL_FUNCTION(OC9, RPF2R, 13),
  1364. PIC32_PINCTRL_FUNCTION(C2TX, RPF2R, 15)),
  1365. PIC32_PINCTRL_GROUP(83, F3,
  1366. PIC32_PINCTRL_FUNCTION(INT1, INT1R, 8),
  1367. PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 8),
  1368. PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 8),
  1369. PIC32_PINCTRL_FUNCTION(IC1, IC1R, 8),
  1370. PIC32_PINCTRL_FUNCTION(IC6, IC6R, 8),
  1371. PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 8),
  1372. PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 8),
  1373. PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 8),
  1374. PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 8),
  1375. PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 8),
  1376. PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 8),
  1377. PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 8),
  1378. PIC32_PINCTRL_FUNCTION(U1RTS, RPF3R, 1),
  1379. PIC32_PINCTRL_FUNCTION(U2TX, RPF3R, 2),
  1380. PIC32_PINCTRL_FUNCTION(U5RTS, RPF3R, 3),
  1381. PIC32_PINCTRL_FUNCTION(U6TX, RPF3R, 4),
  1382. PIC32_PINCTRL_FUNCTION(SS2OUT, RPF3R, 6),
  1383. PIC32_PINCTRL_FUNCTION(SDO4, RPF3R, 8),
  1384. PIC32_PINCTRL_FUNCTION(SDO6, RPF3R, 10),
  1385. PIC32_PINCTRL_FUNCTION(OC2, RPF3R, 11),
  1386. PIC32_PINCTRL_FUNCTION(OC1, RPF3R, 12),
  1387. PIC32_PINCTRL_FUNCTION(OC9, RPF3R, 13),
  1388. PIC32_PINCTRL_FUNCTION(C2TX, RPF3R, 15)),
  1389. PIC32_PINCTRL_GROUP(84, F4,
  1390. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 2),
  1391. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 2),
  1392. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 2),
  1393. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 2),
  1394. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 2),
  1395. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 2),
  1396. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 2),
  1397. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 2),
  1398. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 2),
  1399. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 2),
  1400. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 2),
  1401. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 2),
  1402. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 2),
  1403. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 2),
  1404. PIC32_PINCTRL_FUNCTION(U3TX, RPF4R, 1),
  1405. PIC32_PINCTRL_FUNCTION(U4RTS, RPF4R, 2),
  1406. PIC32_PINCTRL_FUNCTION(SDO1, RPF4R, 5),
  1407. PIC32_PINCTRL_FUNCTION(SDO2, RPF4R, 6),
  1408. PIC32_PINCTRL_FUNCTION(SDO3, RPF4R, 7),
  1409. PIC32_PINCTRL_FUNCTION(SDO5, RPF4R, 9),
  1410. PIC32_PINCTRL_FUNCTION(SS6OUT, RPF4R, 10),
  1411. PIC32_PINCTRL_FUNCTION(OC3, RPF4R, 11),
  1412. PIC32_PINCTRL_FUNCTION(OC6, RPF4R, 12),
  1413. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPF4R, 13),
  1414. PIC32_PINCTRL_FUNCTION(C2OUT, RPF4R, 14),
  1415. PIC32_PINCTRL_FUNCTION(C1TX, RPF4R, 15)),
  1416. PIC32_PINCTRL_GROUP(85, F5,
  1417. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 2),
  1418. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 2),
  1419. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 2),
  1420. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 2),
  1421. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 2),
  1422. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 2),
  1423. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 2),
  1424. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 2),
  1425. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 2),
  1426. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 2),
  1427. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 2),
  1428. PIC32_PINCTRL_FUNCTION(U1TX, RPF5R, 1),
  1429. PIC32_PINCTRL_FUNCTION(U2RTS, RPF5R, 2),
  1430. PIC32_PINCTRL_FUNCTION(U5TX, RPF5R, 3),
  1431. PIC32_PINCTRL_FUNCTION(U6RTS, RPF5R, 4),
  1432. PIC32_PINCTRL_FUNCTION(SDO1, RPF5R, 5),
  1433. PIC32_PINCTRL_FUNCTION(SDO2, RPF5R, 6),
  1434. PIC32_PINCTRL_FUNCTION(SDO3, RPF5R, 7),
  1435. PIC32_PINCTRL_FUNCTION(SDO4, RPF5R, 8),
  1436. PIC32_PINCTRL_FUNCTION(SDO5, RPF5R, 9),
  1437. PIC32_PINCTRL_FUNCTION(OC4, RPF5R, 11),
  1438. PIC32_PINCTRL_FUNCTION(OC7, RPF5R, 12),
  1439. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPF5R, 15)),
  1440. PIC32_PINCTRL_GROUP(88, F8,
  1441. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 11),
  1442. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 11),
  1443. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 11),
  1444. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 11),
  1445. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 11),
  1446. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 11),
  1447. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 11),
  1448. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 11),
  1449. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 11),
  1450. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 11),
  1451. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 11),
  1452. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 11),
  1453. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 11),
  1454. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 11),
  1455. PIC32_PINCTRL_FUNCTION(U3RTS, RPF8R, 1),
  1456. PIC32_PINCTRL_FUNCTION(U4TX, RPF8R, 2),
  1457. PIC32_PINCTRL_FUNCTION(U6TX, RPF8R, 4),
  1458. PIC32_PINCTRL_FUNCTION(SS1OUT, RPF8R, 5),
  1459. PIC32_PINCTRL_FUNCTION(SS3OUT, RPF8R, 7),
  1460. PIC32_PINCTRL_FUNCTION(SS4OUT, RPF8R, 8),
  1461. PIC32_PINCTRL_FUNCTION(SS5OUT, RPF8R, 9),
  1462. PIC32_PINCTRL_FUNCTION(SDO6, RPF8R, 10),
  1463. PIC32_PINCTRL_FUNCTION(OC5, RPF8R, 11),
  1464. PIC32_PINCTRL_FUNCTION(OC8, RPF8R, 12),
  1465. PIC32_PINCTRL_FUNCTION(C1OUT, RPF8R, 14),
  1466. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPF8R, 15)),
  1467. PIC32_PINCTRL_GROUP(92, F12,
  1468. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 9),
  1469. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 9),
  1470. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 9),
  1471. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 9),
  1472. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 9),
  1473. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 9),
  1474. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 9),
  1475. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 9),
  1476. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 9),
  1477. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 9),
  1478. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 9),
  1479. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 9),
  1480. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 9),
  1481. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 9),
  1482. PIC32_PINCTRL_FUNCTION(U3RTS, RPF12R, 1),
  1483. PIC32_PINCTRL_FUNCTION(U4TX, RPF12R, 2),
  1484. PIC32_PINCTRL_FUNCTION(U6TX, RPF12R, 4),
  1485. PIC32_PINCTRL_FUNCTION(SS1OUT, RPF12R, 5),
  1486. PIC32_PINCTRL_FUNCTION(SS3OUT, RPF12R, 7),
  1487. PIC32_PINCTRL_FUNCTION(SS4OUT, RPF12R, 8),
  1488. PIC32_PINCTRL_FUNCTION(SS5OUT, RPF12R, 9),
  1489. PIC32_PINCTRL_FUNCTION(SDO6, RPF12R, 10),
  1490. PIC32_PINCTRL_FUNCTION(OC5, RPF12R, 11),
  1491. PIC32_PINCTRL_FUNCTION(OC8, RPF12R, 12),
  1492. PIC32_PINCTRL_FUNCTION(C1OUT, RPF12R, 14),
  1493. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPF12R, 15)),
  1494. PIC32_PINCTRL_GROUP(93, F13,
  1495. PIC32_PINCTRL_FUNCTION(INT1, INT1R, 9),
  1496. PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 9),
  1497. PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 9),
  1498. PIC32_PINCTRL_FUNCTION(IC1, IC1R, 9),
  1499. PIC32_PINCTRL_FUNCTION(IC6, IC6R, 9),
  1500. PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 9),
  1501. PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 9),
  1502. PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 9),
  1503. PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 9),
  1504. PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 9),
  1505. PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 9),
  1506. PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 9),
  1507. PIC32_PINCTRL_FUNCTION(U1RTS, RPF13R, 1),
  1508. PIC32_PINCTRL_FUNCTION(U2TX, RPF13R, 2),
  1509. PIC32_PINCTRL_FUNCTION(U5RTS, RPF13R, 3),
  1510. PIC32_PINCTRL_FUNCTION(U6TX, RPF13R, 4),
  1511. PIC32_PINCTRL_FUNCTION(SS2OUT, RPF13R, 6),
  1512. PIC32_PINCTRL_FUNCTION(SDO4, RPF13R, 8),
  1513. PIC32_PINCTRL_FUNCTION(SDO6, RPF13R, 10),
  1514. PIC32_PINCTRL_FUNCTION(OC2, RPF13R, 11),
  1515. PIC32_PINCTRL_FUNCTION(OC1, RPF13R, 12),
  1516. PIC32_PINCTRL_FUNCTION(OC9, RPF13R, 13),
  1517. PIC32_PINCTRL_FUNCTION(C2TX, RPF13R, 15)),
  1518. PIC32_PINCTRL_GROUP(96, G0,
  1519. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 12),
  1520. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 12),
  1521. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 12),
  1522. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 12),
  1523. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 12),
  1524. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 12),
  1525. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 12),
  1526. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 12),
  1527. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 12),
  1528. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 12),
  1529. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 12),
  1530. PIC32_PINCTRL_FUNCTION(U1TX, RPG0R, 1),
  1531. PIC32_PINCTRL_FUNCTION(U2RTS, RPG0R, 2),
  1532. PIC32_PINCTRL_FUNCTION(U5TX, RPG0R, 3),
  1533. PIC32_PINCTRL_FUNCTION(U6RTS, RPG0R, 4),
  1534. PIC32_PINCTRL_FUNCTION(SDO1, RPG0R, 5),
  1535. PIC32_PINCTRL_FUNCTION(SDO2, RPG0R, 6),
  1536. PIC32_PINCTRL_FUNCTION(SDO3, RPG0R, 7),
  1537. PIC32_PINCTRL_FUNCTION(SDO4, RPG0R, 8),
  1538. PIC32_PINCTRL_FUNCTION(SDO5, RPG0R, 9),
  1539. PIC32_PINCTRL_FUNCTION(OC4, RPG0R, 11),
  1540. PIC32_PINCTRL_FUNCTION(OC7, RPG0R, 12),
  1541. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPG0R, 15)),
  1542. PIC32_PINCTRL_GROUP(97, G1,
  1543. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 12),
  1544. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 12),
  1545. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 12),
  1546. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 12),
  1547. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 12),
  1548. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 12),
  1549. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 12),
  1550. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 12),
  1551. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 12),
  1552. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 12),
  1553. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 12),
  1554. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 12),
  1555. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 12),
  1556. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 12),
  1557. PIC32_PINCTRL_FUNCTION(U3TX, RPG1R, 1),
  1558. PIC32_PINCTRL_FUNCTION(U4RTS, RPG1R, 2),
  1559. PIC32_PINCTRL_FUNCTION(SDO1, RPG1R, 5),
  1560. PIC32_PINCTRL_FUNCTION(SDO2, RPG1R, 6),
  1561. PIC32_PINCTRL_FUNCTION(SDO3, RPG1R, 7),
  1562. PIC32_PINCTRL_FUNCTION(SDO5, RPG1R, 9),
  1563. PIC32_PINCTRL_FUNCTION(SS6OUT, RPG1R, 10),
  1564. PIC32_PINCTRL_FUNCTION(OC3, RPG1R, 11),
  1565. PIC32_PINCTRL_FUNCTION(OC6, RPG1R, 12),
  1566. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPG1R, 13),
  1567. PIC32_PINCTRL_FUNCTION(C2OUT, RPG1R, 14),
  1568. PIC32_PINCTRL_FUNCTION(C1TX, RPG1R, 15)),
  1569. PIC32_PINCTRL_GROUP(102, G6,
  1570. PIC32_PINCTRL_FUNCTION(INT2, INT2R, 1),
  1571. PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 1),
  1572. PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 1),
  1573. PIC32_PINCTRL_FUNCTION(IC2, IC2R, 1),
  1574. PIC32_PINCTRL_FUNCTION(IC5, IC5R, 1),
  1575. PIC32_PINCTRL_FUNCTION(IC9, IC9R, 1),
  1576. PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 1),
  1577. PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 1),
  1578. PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 1),
  1579. PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 1),
  1580. PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 1),
  1581. PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 1),
  1582. PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 1),
  1583. PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 1),
  1584. PIC32_PINCTRL_FUNCTION(U3RTS, RPG6R, 1),
  1585. PIC32_PINCTRL_FUNCTION(U4TX, RPG6R, 2),
  1586. PIC32_PINCTRL_FUNCTION(U6TX, RPG6R, 4),
  1587. PIC32_PINCTRL_FUNCTION(SS1OUT, RPG6R, 5),
  1588. PIC32_PINCTRL_FUNCTION(SS3OUT, RPG6R, 7),
  1589. PIC32_PINCTRL_FUNCTION(SS4OUT, RPG6R, 8),
  1590. PIC32_PINCTRL_FUNCTION(SS5OUT, RPG6R, 9),
  1591. PIC32_PINCTRL_FUNCTION(SDO6, RPG6R, 10),
  1592. PIC32_PINCTRL_FUNCTION(OC5, RPG6R, 11),
  1593. PIC32_PINCTRL_FUNCTION(OC8, RPG6R, 12),
  1594. PIC32_PINCTRL_FUNCTION(C1OUT, RPG6R, 14),
  1595. PIC32_PINCTRL_FUNCTION(REFCLKO3, RPG6R, 15)),
  1596. PIC32_PINCTRL_GROUP(103, G7,
  1597. PIC32_PINCTRL_FUNCTION(INT4, INT4R, 1),
  1598. PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 1),
  1599. PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 1),
  1600. PIC32_PINCTRL_FUNCTION(IC4, IC4R, 1),
  1601. PIC32_PINCTRL_FUNCTION(IC8, IC8R, 1),
  1602. PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 1),
  1603. PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 1),
  1604. PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 1),
  1605. PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 1),
  1606. PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 1),
  1607. PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 1),
  1608. PIC32_PINCTRL_FUNCTION(U1TX, RPG7R, 1),
  1609. PIC32_PINCTRL_FUNCTION(U2RTS, RPG7R, 2),
  1610. PIC32_PINCTRL_FUNCTION(U5TX, RPG7R, 3),
  1611. PIC32_PINCTRL_FUNCTION(U6RTS, RPG7R, 4),
  1612. PIC32_PINCTRL_FUNCTION(SDO1, RPG7R, 5),
  1613. PIC32_PINCTRL_FUNCTION(SDO2, RPG7R, 6),
  1614. PIC32_PINCTRL_FUNCTION(SDO3, RPG7R, 7),
  1615. PIC32_PINCTRL_FUNCTION(SDO4, RPG7R, 8),
  1616. PIC32_PINCTRL_FUNCTION(SDO5, RPG7R, 9),
  1617. PIC32_PINCTRL_FUNCTION(OC4, RPG7R, 11),
  1618. PIC32_PINCTRL_FUNCTION(OC7, RPG7R, 12),
  1619. PIC32_PINCTRL_FUNCTION(REFCLKO1, RPG7R, 15)),
  1620. PIC32_PINCTRL_GROUP(104, G8,
  1621. PIC32_PINCTRL_FUNCTION(INT3, INT3R, 1),
  1622. PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 1),
  1623. PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 1),
  1624. PIC32_PINCTRL_FUNCTION(IC3, IC3R, 1),
  1625. PIC32_PINCTRL_FUNCTION(IC7, IC7R, 1),
  1626. PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 1),
  1627. PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 1),
  1628. PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 1),
  1629. PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 1),
  1630. PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 1),
  1631. PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 1),
  1632. PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 1),
  1633. PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 1),
  1634. PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 1),
  1635. PIC32_PINCTRL_FUNCTION(U3TX, RPG8R, 1),
  1636. PIC32_PINCTRL_FUNCTION(U4RTS, RPG8R, 2),
  1637. PIC32_PINCTRL_FUNCTION(SDO1, RPG8R, 5),
  1638. PIC32_PINCTRL_FUNCTION(SDO2, RPG8R, 6),
  1639. PIC32_PINCTRL_FUNCTION(SDO3, RPG8R, 7),
  1640. PIC32_PINCTRL_FUNCTION(SDO5, RPG8R, 9),
  1641. PIC32_PINCTRL_FUNCTION(SS6OUT, RPG8R, 10),
  1642. PIC32_PINCTRL_FUNCTION(OC3, RPG8R, 11),
  1643. PIC32_PINCTRL_FUNCTION(OC6, RPG8R, 12),
  1644. PIC32_PINCTRL_FUNCTION(REFCLKO4, RPG8R, 13),
  1645. PIC32_PINCTRL_FUNCTION(C2OUT, RPG8R, 14),
  1646. PIC32_PINCTRL_FUNCTION(C1TX, RPG8R, 15)),
  1647. PIC32_PINCTRL_GROUP(105, G9,
  1648. PIC32_PINCTRL_FUNCTION(INT1, INT1R, 1),
  1649. PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 1),
  1650. PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 1),
  1651. PIC32_PINCTRL_FUNCTION(IC1, IC1R, 1),
  1652. PIC32_PINCTRL_FUNCTION(IC6, IC6R, 1),
  1653. PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 1),
  1654. PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 1),
  1655. PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 1),
  1656. PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 1),
  1657. PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 1),
  1658. PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 1),
  1659. PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 1),
  1660. PIC32_PINCTRL_FUNCTION(U1RTS, RPG9R, 1),
  1661. PIC32_PINCTRL_FUNCTION(U2TX, RPG9R, 2),
  1662. PIC32_PINCTRL_FUNCTION(U5RTS, RPG9R, 3),
  1663. PIC32_PINCTRL_FUNCTION(U6TX, RPG9R, 4),
  1664. PIC32_PINCTRL_FUNCTION(SS2OUT, RPG9R, 6),
  1665. PIC32_PINCTRL_FUNCTION(SDO4, RPG9R, 8),
  1666. PIC32_PINCTRL_FUNCTION(SDO6, RPG9R, 10),
  1667. PIC32_PINCTRL_FUNCTION(OC2, RPG9R, 11),
  1668. PIC32_PINCTRL_FUNCTION(OC1, RPG9R, 12),
  1669. PIC32_PINCTRL_FUNCTION(OC9, RPG9R, 13),
  1670. PIC32_PINCTRL_FUNCTION(C2TX, RPG9R, 15)),
  1671. };
  1672. static inline struct pic32_gpio_bank *irqd_to_bank(struct irq_data *d)
  1673. {
  1674. return gpiochip_get_data(irq_data_get_irq_chip_data(d));
  1675. }
  1676. static inline struct pic32_gpio_bank *pctl_to_bank(struct pic32_pinctrl *pctl,
  1677. unsigned pin)
  1678. {
  1679. return &pctl->gpio_banks[pin / PINS_PER_BANK];
  1680. }
  1681. static int pic32_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
  1682. {
  1683. struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1684. return pctl->ngroups;
  1685. }
  1686. static const char *pic32_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
  1687. unsigned group)
  1688. {
  1689. struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1690. return pctl->groups[group].name;
  1691. }
  1692. static int pic32_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
  1693. unsigned group,
  1694. const unsigned **pins,
  1695. unsigned *num_pins)
  1696. {
  1697. struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1698. *pins = &pctl->groups[group].pin;
  1699. *num_pins = 1;
  1700. return 0;
  1701. }
  1702. static const struct pinctrl_ops pic32_pinctrl_ops = {
  1703. .get_groups_count = pic32_pinctrl_get_groups_count,
  1704. .get_group_name = pic32_pinctrl_get_group_name,
  1705. .get_group_pins = pic32_pinctrl_get_group_pins,
  1706. .dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
  1707. .dt_free_map = pinctrl_utils_free_map,
  1708. };
  1709. static int pic32_pinmux_get_functions_count(struct pinctrl_dev *pctldev)
  1710. {
  1711. struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1712. return pctl->nfunctions;
  1713. }
  1714. static const char *
  1715. pic32_pinmux_get_function_name(struct pinctrl_dev *pctldev, unsigned func)
  1716. {
  1717. struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1718. return pctl->functions[func].name;
  1719. }
  1720. static int pic32_pinmux_get_function_groups(struct pinctrl_dev *pctldev,
  1721. unsigned func,
  1722. const char * const **groups,
  1723. unsigned * const num_groups)
  1724. {
  1725. struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1726. *groups = pctl->functions[func].groups;
  1727. *num_groups = pctl->functions[func].ngroups;
  1728. return 0;
  1729. }
  1730. static int pic32_pinmux_enable(struct pinctrl_dev *pctldev,
  1731. unsigned func, unsigned group)
  1732. {
  1733. struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1734. const struct pic32_pin_group *pg = &pctl->groups[group];
  1735. const struct pic32_function *pf = &pctl->functions[func];
  1736. const char *fname = pf->name;
  1737. struct pic32_desc_function *functions = pg->functions;
  1738. while (functions->name) {
  1739. if (!strcmp(functions->name, fname)) {
  1740. dev_dbg(pctl->dev,
  1741. "setting function %s reg 0x%x = %d\n",
  1742. fname, functions->muxreg, functions->muxval);
  1743. writel(functions->muxval, pctl->reg_base + functions->muxreg);
  1744. return 0;
  1745. }
  1746. functions++;
  1747. }
  1748. dev_err(pctl->dev, "cannot mux pin %u to function %u\n", group, func);
  1749. return -EINVAL;
  1750. }
  1751. static int pic32_gpio_request_enable(struct pinctrl_dev *pctldev,
  1752. struct pinctrl_gpio_range *range,
  1753. unsigned offset)
  1754. {
  1755. struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1756. struct pic32_gpio_bank *bank = gpiochip_get_data(range->gc);
  1757. u32 mask = BIT(offset - bank->gpio_chip.base);
  1758. dev_dbg(pctl->dev, "requesting gpio %d in bank %d with mask 0x%x\n",
  1759. offset, bank->gpio_chip.base, mask);
  1760. writel(mask, bank->reg_base + PIC32_CLR(ANSEL_REG));
  1761. return 0;
  1762. }
  1763. static int pic32_gpio_direction_input(struct gpio_chip *chip,
  1764. unsigned offset)
  1765. {
  1766. struct pic32_gpio_bank *bank = gpiochip_get_data(chip);
  1767. u32 mask = BIT(offset);
  1768. writel(mask, bank->reg_base + PIC32_SET(TRIS_REG));
  1769. return 0;
  1770. }
  1771. static int pic32_gpio_get(struct gpio_chip *chip, unsigned offset)
  1772. {
  1773. struct pic32_gpio_bank *bank = gpiochip_get_data(chip);
  1774. return !!(readl(bank->reg_base + PORT_REG) & BIT(offset));
  1775. }
  1776. static void pic32_gpio_set(struct gpio_chip *chip, unsigned offset,
  1777. int value)
  1778. {
  1779. struct pic32_gpio_bank *bank = gpiochip_get_data(chip);
  1780. u32 mask = BIT(offset);
  1781. if (value)
  1782. writel(mask, bank->reg_base + PIC32_SET(PORT_REG));
  1783. else
  1784. writel(mask, bank->reg_base + PIC32_CLR(PORT_REG));
  1785. }
  1786. static int pic32_gpio_direction_output(struct gpio_chip *chip,
  1787. unsigned offset, int value)
  1788. {
  1789. struct pic32_gpio_bank *bank = gpiochip_get_data(chip);
  1790. u32 mask = BIT(offset);
  1791. pic32_gpio_set(chip, offset, value);
  1792. writel(mask, bank->reg_base + PIC32_CLR(TRIS_REG));
  1793. return 0;
  1794. }
  1795. static int pic32_gpio_set_direction(struct pinctrl_dev *pctldev,
  1796. struct pinctrl_gpio_range *range,
  1797. unsigned offset, bool input)
  1798. {
  1799. struct gpio_chip *chip = range->gc;
  1800. if (input)
  1801. pic32_gpio_direction_input(chip, offset);
  1802. else
  1803. pic32_gpio_direction_output(chip, offset, 0);
  1804. return 0;
  1805. }
  1806. static const struct pinmux_ops pic32_pinmux_ops = {
  1807. .get_functions_count = pic32_pinmux_get_functions_count,
  1808. .get_function_name = pic32_pinmux_get_function_name,
  1809. .get_function_groups = pic32_pinmux_get_function_groups,
  1810. .set_mux = pic32_pinmux_enable,
  1811. .gpio_request_enable = pic32_gpio_request_enable,
  1812. .gpio_set_direction = pic32_gpio_set_direction,
  1813. };
  1814. static int pic32_pinconf_get(struct pinctrl_dev *pctldev, unsigned pin,
  1815. unsigned long *config)
  1816. {
  1817. struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1818. struct pic32_gpio_bank *bank = pctl_to_bank(pctl, pin);
  1819. unsigned param = pinconf_to_config_param(*config);
  1820. u32 mask = BIT(pin - bank->gpio_chip.base);
  1821. u32 arg;
  1822. switch (param) {
  1823. case PIN_CONFIG_BIAS_PULL_UP:
  1824. arg = !!(readl(bank->reg_base + CNPU_REG) & mask);
  1825. break;
  1826. case PIN_CONFIG_BIAS_PULL_DOWN:
  1827. arg = !!(readl(bank->reg_base + CNPD_REG) & mask);
  1828. break;
  1829. case PIN_CONFIG_MICROCHIP_DIGITAL:
  1830. arg = !(readl(bank->reg_base + ANSEL_REG) & mask);
  1831. break;
  1832. case PIN_CONFIG_MICROCHIP_ANALOG:
  1833. arg = !!(readl(bank->reg_base + ANSEL_REG) & mask);
  1834. break;
  1835. case PIN_CONFIG_DRIVE_OPEN_DRAIN:
  1836. arg = !!(readl(bank->reg_base + ODCU_REG) & mask);
  1837. break;
  1838. case PIN_CONFIG_INPUT_ENABLE:
  1839. arg = !!(readl(bank->reg_base + TRIS_REG) & mask);
  1840. break;
  1841. case PIN_CONFIG_OUTPUT:
  1842. arg = !(readl(bank->reg_base + TRIS_REG) & mask);
  1843. break;
  1844. default:
  1845. dev_err(pctl->dev, "Property %u not supported\n", param);
  1846. return -ENOTSUPP;
  1847. }
  1848. *config = pinconf_to_config_packed(param, arg);
  1849. return 0;
  1850. }
  1851. static int pic32_pinconf_set(struct pinctrl_dev *pctldev, unsigned pin,
  1852. unsigned long *configs, unsigned num_configs)
  1853. {
  1854. struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
  1855. struct pic32_gpio_bank *bank = pctl_to_bank(pctl, pin);
  1856. unsigned param;
  1857. u32 arg;
  1858. unsigned int i;
  1859. u32 offset = pin - bank->gpio_chip.base;
  1860. u32 mask = BIT(offset);
  1861. dev_dbg(pctl->dev, "setting pin %d bank %d mask 0x%x\n",
  1862. pin, bank->gpio_chip.base, mask);
  1863. for (i = 0; i < num_configs; i++) {
  1864. param = pinconf_to_config_param(configs[i]);
  1865. arg = pinconf_to_config_argument(configs[i]);
  1866. switch (param) {
  1867. case PIN_CONFIG_BIAS_PULL_UP:
  1868. dev_dbg(pctl->dev, " pullup\n");
  1869. writel(mask, bank->reg_base +PIC32_SET(CNPU_REG));
  1870. break;
  1871. case PIN_CONFIG_BIAS_PULL_DOWN:
  1872. dev_dbg(pctl->dev, " pulldown\n");
  1873. writel(mask, bank->reg_base + PIC32_SET(CNPD_REG));
  1874. break;
  1875. case PIN_CONFIG_MICROCHIP_DIGITAL:
  1876. dev_dbg(pctl->dev, " digital\n");
  1877. writel(mask, bank->reg_base + PIC32_CLR(ANSEL_REG));
  1878. break;
  1879. case PIN_CONFIG_MICROCHIP_ANALOG:
  1880. dev_dbg(pctl->dev, " analog\n");
  1881. writel(mask, bank->reg_base + PIC32_SET(ANSEL_REG));
  1882. break;
  1883. case PIN_CONFIG_DRIVE_OPEN_DRAIN:
  1884. dev_dbg(pctl->dev, " opendrain\n");
  1885. writel(mask, bank->reg_base + PIC32_SET(ODCU_REG));
  1886. break;
  1887. case PIN_CONFIG_INPUT_ENABLE:
  1888. pic32_gpio_direction_input(&bank->gpio_chip, offset);
  1889. break;
  1890. case PIN_CONFIG_OUTPUT:
  1891. pic32_gpio_direction_output(&bank->gpio_chip,
  1892. offset, arg);
  1893. break;
  1894. default:
  1895. dev_err(pctl->dev, "Property %u not supported\n",
  1896. param);
  1897. return -ENOTSUPP;
  1898. }
  1899. }
  1900. return 0;
  1901. }
  1902. static const struct pinconf_ops pic32_pinconf_ops = {
  1903. .pin_config_get = pic32_pinconf_get,
  1904. .pin_config_set = pic32_pinconf_set,
  1905. .is_generic = true,
  1906. };
  1907. static struct pinctrl_desc pic32_pinctrl_desc = {
  1908. .name = "pic32-pinctrl",
  1909. .pctlops = &pic32_pinctrl_ops,
  1910. .pmxops = &pic32_pinmux_ops,
  1911. .confops = &pic32_pinconf_ops,
  1912. .owner = THIS_MODULE,
  1913. };
  1914. static int pic32_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
  1915. {
  1916. struct pic32_gpio_bank *bank = gpiochip_get_data(chip);
  1917. return !!(readl(bank->reg_base + TRIS_REG) & BIT(offset));
  1918. }
  1919. static void pic32_gpio_irq_ack(struct irq_data *data)
  1920. {
  1921. struct pic32_gpio_bank *bank = irqd_to_bank(data);
  1922. writel(0, bank->reg_base + CNF_REG);
  1923. }
  1924. static void pic32_gpio_irq_mask(struct irq_data *data)
  1925. {
  1926. struct pic32_gpio_bank *bank = irqd_to_bank(data);
  1927. writel(BIT(PIC32_CNCON_ON), bank->reg_base + PIC32_CLR(CNCON_REG));
  1928. }
  1929. static void pic32_gpio_irq_unmask(struct irq_data *data)
  1930. {
  1931. struct pic32_gpio_bank *bank = irqd_to_bank(data);
  1932. writel(BIT(PIC32_CNCON_ON), bank->reg_base + PIC32_SET(CNCON_REG));
  1933. }
  1934. static unsigned int pic32_gpio_irq_startup(struct irq_data *data)
  1935. {
  1936. struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
  1937. pic32_gpio_direction_input(chip, data->hwirq);
  1938. pic32_gpio_irq_unmask(data);
  1939. return 0;
  1940. }
  1941. static int pic32_gpio_irq_set_type(struct irq_data *data, unsigned int type)
  1942. {
  1943. struct pic32_gpio_bank *bank = irqd_to_bank(data);
  1944. u32 mask = BIT(data->hwirq);
  1945. switch (type & IRQ_TYPE_SENSE_MASK) {
  1946. case IRQ_TYPE_EDGE_RISING:
  1947. /* enable RISE */
  1948. writel(mask, bank->reg_base + PIC32_SET(CNEN_REG));
  1949. /* disable FALL */
  1950. writel(mask, bank->reg_base + PIC32_CLR(CNNE_REG));
  1951. /* enable EDGE */
  1952. writel(BIT(PIC32_CNCON_EDGE), bank->reg_base + PIC32_SET(CNCON_REG));
  1953. break;
  1954. case IRQ_TYPE_EDGE_FALLING:
  1955. /* disable RISE */
  1956. writel(mask, bank->reg_base + PIC32_CLR(CNEN_REG));
  1957. /* enable FALL */
  1958. writel(mask, bank->reg_base + PIC32_SET(CNNE_REG));
  1959. /* enable EDGE */
  1960. writel(BIT(PIC32_CNCON_EDGE), bank->reg_base + PIC32_SET(CNCON_REG));
  1961. break;
  1962. case IRQ_TYPE_EDGE_BOTH:
  1963. /* enable RISE */
  1964. writel(mask, bank->reg_base + PIC32_SET(CNEN_REG));
  1965. /* enable FALL */
  1966. writel(mask, bank->reg_base + PIC32_SET(CNNE_REG));
  1967. /* enable EDGE */
  1968. writel(BIT(PIC32_CNCON_EDGE), bank->reg_base + PIC32_SET(CNCON_REG));
  1969. break;
  1970. default:
  1971. return -EINVAL;
  1972. }
  1973. irq_set_handler_locked(data, handle_edge_irq);
  1974. return 0;
  1975. }
  1976. static u32 pic32_gpio_get_pending(struct gpio_chip *gc, unsigned long status)
  1977. {
  1978. struct pic32_gpio_bank *bank = gpiochip_get_data(gc);
  1979. u32 pending = 0;
  1980. u32 cnen_rise, cnne_fall;
  1981. u32 pin;
  1982. cnen_rise = readl(bank->reg_base + CNEN_REG);
  1983. cnne_fall = readl(bank->reg_base + CNNE_REG);
  1984. for_each_set_bit(pin, &status, BITS_PER_LONG) {
  1985. u32 mask = BIT(pin);
  1986. if ((mask & cnen_rise) || (mask && cnne_fall))
  1987. pending |= mask;
  1988. }
  1989. return pending;
  1990. }
  1991. static void pic32_gpio_irq_handler(struct irq_desc *desc)
  1992. {
  1993. struct gpio_chip *gc = irq_desc_get_handler_data(desc);
  1994. struct pic32_gpio_bank *bank = gpiochip_get_data(gc);
  1995. struct irq_chip *chip = irq_desc_get_chip(desc);
  1996. unsigned long pending;
  1997. unsigned int pin;
  1998. u32 stat;
  1999. chained_irq_enter(chip, desc);
  2000. stat = readl(bank->reg_base + CNF_REG);
  2001. pending = pic32_gpio_get_pending(gc, stat);
  2002. for_each_set_bit(pin, &pending, BITS_PER_LONG)
  2003. generic_handle_irq(irq_linear_revmap(gc->irqdomain, pin));
  2004. chained_irq_exit(chip, desc);
  2005. }
  2006. #define GPIO_BANK(_bank, _npins) \
  2007. { \
  2008. .gpio_chip = { \
  2009. .label = "GPIO" #_bank, \
  2010. .request = gpiochip_generic_request, \
  2011. .free = gpiochip_generic_free, \
  2012. .get_direction = pic32_gpio_get_direction, \
  2013. .direction_input = pic32_gpio_direction_input, \
  2014. .direction_output = pic32_gpio_direction_output, \
  2015. .get = pic32_gpio_get, \
  2016. .set = pic32_gpio_set, \
  2017. .ngpio = _npins, \
  2018. .base = GPIO_BANK_START(_bank), \
  2019. .owner = THIS_MODULE, \
  2020. .can_sleep = 0, \
  2021. }, \
  2022. .irq_chip = { \
  2023. .name = "GPIO" #_bank, \
  2024. .irq_startup = pic32_gpio_irq_startup, \
  2025. .irq_ack = pic32_gpio_irq_ack, \
  2026. .irq_mask = pic32_gpio_irq_mask, \
  2027. .irq_unmask = pic32_gpio_irq_unmask, \
  2028. .irq_set_type = pic32_gpio_irq_set_type, \
  2029. }, \
  2030. }
  2031. static struct pic32_gpio_bank pic32_gpio_banks[] = {
  2032. GPIO_BANK(0, PINS_PER_BANK),
  2033. GPIO_BANK(1, PINS_PER_BANK),
  2034. GPIO_BANK(2, PINS_PER_BANK),
  2035. GPIO_BANK(3, PINS_PER_BANK),
  2036. GPIO_BANK(4, PINS_PER_BANK),
  2037. GPIO_BANK(5, PINS_PER_BANK),
  2038. GPIO_BANK(6, PINS_PER_BANK),
  2039. GPIO_BANK(7, PINS_PER_BANK),
  2040. GPIO_BANK(8, PINS_PER_BANK),
  2041. GPIO_BANK(9, PINS_PER_BANK),
  2042. };
  2043. static int pic32_pinctrl_probe(struct platform_device *pdev)
  2044. {
  2045. struct pic32_pinctrl *pctl;
  2046. struct resource *res;
  2047. int ret;
  2048. pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
  2049. if (!pctl)
  2050. return -ENOMEM;
  2051. pctl->dev = &pdev->dev;
  2052. dev_set_drvdata(&pdev->dev, pctl);
  2053. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  2054. pctl->reg_base = devm_ioremap_resource(&pdev->dev, res);
  2055. if (IS_ERR(pctl->reg_base))
  2056. return PTR_ERR(pctl->reg_base);
  2057. pctl->clk = devm_clk_get(&pdev->dev, NULL);
  2058. if (IS_ERR(pctl->clk)) {
  2059. ret = PTR_ERR(pctl->clk);
  2060. dev_err(&pdev->dev, "clk get failed\n");
  2061. return ret;
  2062. }
  2063. ret = clk_prepare_enable(pctl->clk);
  2064. if (ret) {
  2065. dev_err(&pdev->dev, "clk enable failed\n");
  2066. return ret;
  2067. }
  2068. pctl->pins = pic32_pins;
  2069. pctl->npins = ARRAY_SIZE(pic32_pins);
  2070. pctl->functions = pic32_functions;
  2071. pctl->nfunctions = ARRAY_SIZE(pic32_functions);
  2072. pctl->groups = pic32_groups;
  2073. pctl->ngroups = ARRAY_SIZE(pic32_groups);
  2074. pctl->gpio_banks = pic32_gpio_banks;
  2075. pctl->nbanks = ARRAY_SIZE(pic32_gpio_banks);
  2076. pic32_pinctrl_desc.pins = pctl->pins;
  2077. pic32_pinctrl_desc.npins = pctl->npins;
  2078. pic32_pinctrl_desc.custom_params = pic32_mpp_bindings;
  2079. pic32_pinctrl_desc.num_custom_params = ARRAY_SIZE(pic32_mpp_bindings);
  2080. pctl->pctldev = devm_pinctrl_register(&pdev->dev, &pic32_pinctrl_desc,
  2081. pctl);
  2082. if (IS_ERR(pctl->pctldev)) {
  2083. dev_err(&pdev->dev, "Failed to register pinctrl device\n");
  2084. return PTR_ERR(pctl->pctldev);
  2085. }
  2086. return 0;
  2087. }
  2088. static int pic32_gpio_probe(struct platform_device *pdev)
  2089. {
  2090. struct device_node *np = pdev->dev.of_node;
  2091. struct pic32_gpio_bank *bank;
  2092. u32 id;
  2093. int irq, ret;
  2094. struct resource *res;
  2095. if (of_property_read_u32(np, "microchip,gpio-bank", &id)) {
  2096. dev_err(&pdev->dev, "microchip,gpio-bank property not found\n");
  2097. return -EINVAL;
  2098. }
  2099. if (id >= ARRAY_SIZE(pic32_gpio_banks)) {
  2100. dev_err(&pdev->dev, "invalid microchip,gpio-bank property\n");
  2101. return -EINVAL;
  2102. }
  2103. bank = &pic32_gpio_banks[id];
  2104. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  2105. bank->reg_base = devm_ioremap_resource(&pdev->dev, res);
  2106. if (IS_ERR(bank->reg_base))
  2107. return PTR_ERR(bank->reg_base);
  2108. irq = platform_get_irq(pdev, 0);
  2109. if (irq < 0) {
  2110. dev_err(&pdev->dev, "irq get failed\n");
  2111. return irq;
  2112. }
  2113. bank->clk = devm_clk_get(&pdev->dev, NULL);
  2114. if (IS_ERR(bank->clk)) {
  2115. ret = PTR_ERR(bank->clk);
  2116. dev_err(&pdev->dev, "clk get failed\n");
  2117. return ret;
  2118. }
  2119. ret = clk_prepare_enable(bank->clk);
  2120. if (ret) {
  2121. dev_err(&pdev->dev, "clk enable failed\n");
  2122. return ret;
  2123. }
  2124. bank->gpio_chip.parent = &pdev->dev;
  2125. bank->gpio_chip.of_node = np;
  2126. ret = gpiochip_add_data(&bank->gpio_chip, bank);
  2127. if (ret < 0) {
  2128. dev_err(&pdev->dev, "Failed to add GPIO chip %u: %d\n",
  2129. id, ret);
  2130. return ret;
  2131. }
  2132. ret = gpiochip_irqchip_add(&bank->gpio_chip, &bank->irq_chip,
  2133. 0, handle_level_irq, IRQ_TYPE_NONE);
  2134. if (ret < 0) {
  2135. dev_err(&pdev->dev, "Failed to add IRQ chip %u: %d\n",
  2136. id, ret);
  2137. gpiochip_remove(&bank->gpio_chip);
  2138. return ret;
  2139. }
  2140. gpiochip_set_chained_irqchip(&bank->gpio_chip, &bank->irq_chip,
  2141. irq, pic32_gpio_irq_handler);
  2142. return 0;
  2143. }
  2144. static const struct of_device_id pic32_pinctrl_of_match[] = {
  2145. { .compatible = "microchip,pic32mzda-pinctrl", },
  2146. { },
  2147. };
  2148. static struct platform_driver pic32_pinctrl_driver = {
  2149. .driver = {
  2150. .name = "pic32-pinctrl",
  2151. .of_match_table = pic32_pinctrl_of_match,
  2152. .suppress_bind_attrs = true,
  2153. },
  2154. .probe = pic32_pinctrl_probe,
  2155. };
  2156. static const struct of_device_id pic32_gpio_of_match[] = {
  2157. { .compatible = "microchip,pic32mzda-gpio", },
  2158. { },
  2159. };
  2160. static struct platform_driver pic32_gpio_driver = {
  2161. .driver = {
  2162. .name = "pic32-gpio",
  2163. .of_match_table = pic32_gpio_of_match,
  2164. .suppress_bind_attrs = true,
  2165. },
  2166. .probe = pic32_gpio_probe,
  2167. };
  2168. static int __init pic32_gpio_register(void)
  2169. {
  2170. return platform_driver_register(&pic32_gpio_driver);
  2171. }
  2172. arch_initcall(pic32_gpio_register);
  2173. static int __init pic32_pinctrl_register(void)
  2174. {
  2175. return platform_driver_register(&pic32_pinctrl_driver);
  2176. }
  2177. arch_initcall(pic32_pinctrl_register);