pinctrl-aspeed-g5.c 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879
  1. /*
  2. * Copyright (C) 2016 IBM Corp.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. */
  9. #include <linux/bitops.h>
  10. #include <linux/init.h>
  11. #include <linux/io.h>
  12. #include <linux/kernel.h>
  13. #include <linux/mutex.h>
  14. #include <linux/of.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/pinctrl/pinctrl.h>
  17. #include <linux/pinctrl/pinmux.h>
  18. #include <linux/pinctrl/pinconf.h>
  19. #include <linux/pinctrl/pinconf-generic.h>
  20. #include <linux/string.h>
  21. #include <linux/types.h>
  22. #include "../core.h"
  23. #include "../pinctrl-utils.h"
  24. #include "pinctrl-aspeed.h"
  25. #define ASPEED_G5_NR_PINS 228
  26. #define COND1 { SCU90, BIT(6), 0, 0 }
  27. #define COND2 { SCU94, GENMASK(1, 0), 0, 0 }
  28. #define B14 0
  29. SSSF_PIN_DECL(B14, GPIOA0, MAC1LINK, SIG_DESC_SET(SCU80, 0));
  30. #define E13 3
  31. SSSF_PIN_DECL(E13, GPIOA3, TIMER4, SIG_DESC_SET(SCU80, 3));
  32. #define I2C9_DESC SIG_DESC_SET(SCU90, 22)
  33. #define C14 4
  34. SIG_EXPR_LIST_DECL_SINGLE(SCL9, I2C9, I2C9_DESC, COND1);
  35. SIG_EXPR_LIST_DECL_SINGLE(TIMER5, TIMER5, SIG_DESC_SET(SCU80, 4), COND1);
  36. MS_PIN_DECL(C14, GPIOA4, SCL9, TIMER5);
  37. FUNC_GROUP_DECL(TIMER5, C14);
  38. #define A13 5
  39. SIG_EXPR_LIST_DECL_SINGLE(SDA9, I2C9, I2C9_DESC, COND1);
  40. SIG_EXPR_LIST_DECL_SINGLE(TIMER6, TIMER6, SIG_DESC_SET(SCU80, 5), COND1);
  41. MS_PIN_DECL(A13, GPIOA5, SDA9, TIMER6);
  42. FUNC_GROUP_DECL(TIMER6, A13);
  43. FUNC_GROUP_DECL(I2C9, C14, A13);
  44. #define MDIO2_DESC SIG_DESC_SET(SCU90, 2)
  45. #define C13 6
  46. SIG_EXPR_LIST_DECL_SINGLE(MDC2, MDIO2, MDIO2_DESC, COND1);
  47. SIG_EXPR_LIST_DECL_SINGLE(TIMER7, TIMER7, SIG_DESC_SET(SCU80, 6), COND1);
  48. MS_PIN_DECL(C13, GPIOA6, MDC2, TIMER7);
  49. FUNC_GROUP_DECL(TIMER7, C13);
  50. #define B13 7
  51. SIG_EXPR_LIST_DECL_SINGLE(MDIO2, MDIO2, MDIO2_DESC, COND1);
  52. SIG_EXPR_LIST_DECL_SINGLE(TIMER8, TIMER8, SIG_DESC_SET(SCU80, 7), COND1);
  53. MS_PIN_DECL(B13, GPIOA7, MDIO2, TIMER8);
  54. FUNC_GROUP_DECL(TIMER8, B13);
  55. FUNC_GROUP_DECL(MDIO2, C13, B13);
  56. #define H20 15
  57. GPIO_PIN_DECL(H20, GPIOB7);
  58. #define SD1_DESC SIG_DESC_SET(SCU90, 0)
  59. #define C12 16
  60. #define I2C10_DESC SIG_DESC_SET(SCU90, 23)
  61. SIG_EXPR_LIST_DECL_SINGLE(SD1CLK, SD1, SD1_DESC);
  62. SIG_EXPR_LIST_DECL_SINGLE(SCL10, I2C10, I2C10_DESC);
  63. MS_PIN_DECL(C12, GPIOC0, SD1CLK, SCL10);
  64. #define A12 17
  65. SIG_EXPR_LIST_DECL_SINGLE(SD1CMD, SD1, SD1_DESC);
  66. SIG_EXPR_LIST_DECL_SINGLE(SDA10, I2C10, I2C10_DESC);
  67. MS_PIN_DECL(A12, GPIOC1, SD1CMD, SDA10);
  68. FUNC_GROUP_DECL(I2C10, C12, A12);
  69. #define B12 18
  70. #define I2C11_DESC SIG_DESC_SET(SCU90, 24)
  71. SIG_EXPR_LIST_DECL_SINGLE(SD1DAT0, SD1, SD1_DESC);
  72. SIG_EXPR_LIST_DECL_SINGLE(SCL11, I2C11, I2C11_DESC);
  73. MS_PIN_DECL(B12, GPIOC2, SD1DAT0, SCL11);
  74. #define D9 19
  75. SIG_EXPR_LIST_DECL_SINGLE(SD1DAT1, SD1, SD1_DESC);
  76. SIG_EXPR_LIST_DECL_SINGLE(SDA11, I2C11, I2C11_DESC);
  77. MS_PIN_DECL(D9, GPIOC3, SD1DAT1, SDA11);
  78. FUNC_GROUP_DECL(I2C11, B12, D9);
  79. #define D10 20
  80. #define I2C12_DESC SIG_DESC_SET(SCU90, 25)
  81. SIG_EXPR_LIST_DECL_SINGLE(SD1DAT2, SD1, SD1_DESC);
  82. SIG_EXPR_LIST_DECL_SINGLE(SCL12, I2C12, I2C12_DESC);
  83. MS_PIN_DECL(D10, GPIOC4, SD1DAT2, SCL12);
  84. #define E12 21
  85. SIG_EXPR_LIST_DECL_SINGLE(SD1DAT3, SD1, SD1_DESC);
  86. SIG_EXPR_LIST_DECL_SINGLE(SDA12, I2C12, I2C12_DESC);
  87. MS_PIN_DECL(E12, GPIOC5, SD1DAT3, SDA12);
  88. FUNC_GROUP_DECL(I2C12, D10, E12);
  89. #define C11 22
  90. #define I2C13_DESC SIG_DESC_SET(SCU90, 26)
  91. SIG_EXPR_LIST_DECL_SINGLE(SD1CD, SD1, SD1_DESC);
  92. SIG_EXPR_LIST_DECL_SINGLE(SCL13, I2C13, I2C13_DESC);
  93. MS_PIN_DECL(C11, GPIOC6, SD1CD, SCL13);
  94. #define B11 23
  95. SIG_EXPR_LIST_DECL_SINGLE(SD1WP, SD1, SD1_DESC);
  96. SIG_EXPR_LIST_DECL_SINGLE(SDA13, I2C13, I2C13_DESC);
  97. MS_PIN_DECL(B11, GPIOC7, SD1WP, SDA13);
  98. FUNC_GROUP_DECL(I2C13, C11, B11);
  99. FUNC_GROUP_DECL(SD1, C12, A12, B12, D9, D10, E12, C11, B11);
  100. #define SD2_DESC SIG_DESC_SET(SCU90, 1)
  101. #define GPID0_DESC SIG_DESC_SET(SCU8C, 8)
  102. #define GPID_DESC SIG_DESC_SET(HW_STRAP1, 21)
  103. #define F19 24
  104. SIG_EXPR_LIST_DECL_SINGLE(SD2CLK, SD2, SD2_DESC);
  105. SIG_EXPR_DECL(GPID0IN, GPID0, GPID0_DESC);
  106. SIG_EXPR_DECL(GPID0IN, GPID, GPID_DESC);
  107. SIG_EXPR_LIST_DECL_DUAL(GPID0IN, GPID0, GPID);
  108. MS_PIN_DECL(F19, GPIOD0, SD2CLK, GPID0IN);
  109. #define E21 25
  110. SIG_EXPR_LIST_DECL_SINGLE(SD2CMD, SD2, SD2_DESC);
  111. SIG_EXPR_DECL(GPID0OUT, GPID0, GPID0_DESC);
  112. SIG_EXPR_DECL(GPID0OUT, GPID, GPID_DESC);
  113. SIG_EXPR_LIST_DECL_DUAL(GPID0OUT, GPID0, GPID);
  114. MS_PIN_DECL(E21, GPIOD1, SD2CMD, GPID0OUT);
  115. FUNC_GROUP_DECL(GPID0, F19, E21);
  116. #define GPID2_DESC SIG_DESC_SET(SCU8C, 9)
  117. #define F20 26
  118. SIG_EXPR_LIST_DECL_SINGLE(SD2DAT0, SD2, SD2_DESC);
  119. SIG_EXPR_DECL(GPID2IN, GPID2, GPID2_DESC);
  120. SIG_EXPR_DECL(GPID2IN, GPID, GPID_DESC);
  121. SIG_EXPR_LIST_DECL_DUAL(GPID2IN, GPID2, GPID);
  122. MS_PIN_DECL(F20, GPIOD2, SD2DAT0, GPID2IN);
  123. #define D20 27
  124. SIG_EXPR_LIST_DECL_SINGLE(SD2DAT1, SD2, SD2_DESC);
  125. SIG_EXPR_DECL(GPID2OUT, GPID2, GPID2_DESC);
  126. SIG_EXPR_DECL(GPID2OUT, GPID, GPID_DESC);
  127. SIG_EXPR_LIST_DECL_DUAL(GPID2OUT, GPID2, GPID);
  128. MS_PIN_DECL(D20, GPIOD3, SD2DAT1, GPID2OUT);
  129. FUNC_GROUP_DECL(GPID2, F20, D20);
  130. #define GPIE_DESC SIG_DESC_SET(HW_STRAP1, 21)
  131. #define GPIE0_DESC SIG_DESC_SET(SCU8C, 12)
  132. #define B20 32
  133. SIG_EXPR_LIST_DECL_SINGLE(NCTS3, NCTS3, SIG_DESC_SET(SCU80, 16));
  134. SIG_EXPR_DECL(GPIE0IN, GPIE0, GPIE0_DESC);
  135. SIG_EXPR_DECL(GPIE0IN, GPIE, GPIE_DESC);
  136. SIG_EXPR_LIST_DECL_DUAL(GPIE0IN, GPIE0, GPIE);
  137. MS_PIN_DECL(B20, GPIOE0, NCTS3, GPIE0IN);
  138. #define C20 33
  139. SIG_EXPR_LIST_DECL_SINGLE(NDCD3, NDCD3, SIG_DESC_SET(SCU80, 17));
  140. SIG_EXPR_DECL(GPIE0OUT, GPIE0, GPIE0_DESC);
  141. SIG_EXPR_DECL(GPIE0OUT, GPIE, GPIE_DESC);
  142. SIG_EXPR_LIST_DECL_DUAL(GPIE0OUT, GPIE0, GPIE);
  143. MS_PIN_DECL(C20, GPIOE1, NDCD3, GPIE0OUT);
  144. FUNC_GROUP_DECL(GPIE0, B20, C20);
  145. #define SPI1_DESC { HW_STRAP1, GENMASK(13, 12), 1, 0 }
  146. #define SPI1DEBUG_DESC { HW_STRAP1, GENMASK(13, 12), 2, 0 }
  147. #define SPI1PASSTHRU_DESC { HW_STRAP1, GENMASK(13, 12), 3, 0 }
  148. #define C18 64
  149. SIG_EXPR_DECL(SYSCS, SPI1DEBUG, COND1, SPI1DEBUG_DESC);
  150. SIG_EXPR_DECL(SYSCS, SPI1PASSTHRU, COND1, SPI1PASSTHRU_DESC);
  151. SIG_EXPR_LIST_DECL_DUAL(SYSCS, SPI1DEBUG, SPI1PASSTHRU);
  152. SS_PIN_DECL(C18, GPIOI0, SYSCS);
  153. #define E15 65
  154. SIG_EXPR_DECL(SYSCK, SPI1DEBUG, COND1, SPI1DEBUG_DESC);
  155. SIG_EXPR_DECL(SYSCK, SPI1PASSTHRU, COND1, SPI1PASSTHRU_DESC);
  156. SIG_EXPR_LIST_DECL_DUAL(SYSCK, SPI1DEBUG, SPI1PASSTHRU);
  157. SS_PIN_DECL(E15, GPIOI1, SYSCK);
  158. #define B16 66
  159. SIG_EXPR_DECL(SYSMOSI, SPI1DEBUG, COND1, SPI1DEBUG_DESC);
  160. SIG_EXPR_DECL(SYSMOSI, SPI1PASSTHRU, COND1, SPI1PASSTHRU_DESC);
  161. SIG_EXPR_LIST_DECL_DUAL(SYSMOSI, SPI1DEBUG, SPI1PASSTHRU);
  162. SS_PIN_DECL(B16, GPIOI2, SYSMOSI);
  163. #define C16 67
  164. SIG_EXPR_DECL(SYSMISO, SPI1DEBUG, COND1, SPI1DEBUG_DESC);
  165. SIG_EXPR_DECL(SYSMISO, SPI1PASSTHRU, COND1, SPI1PASSTHRU_DESC);
  166. SIG_EXPR_LIST_DECL_DUAL(SYSMISO, SPI1DEBUG, SPI1PASSTHRU);
  167. SS_PIN_DECL(C16, GPIOI3, SYSMISO);
  168. #define VB_DESC SIG_DESC_SET(HW_STRAP1, 5)
  169. #define B15 68
  170. SIG_EXPR_DECL(SPI1CS0, SPI1, COND1, SPI1_DESC);
  171. SIG_EXPR_DECL(SPI1CS0, SPI1DEBUG, COND1, SPI1DEBUG_DESC);
  172. SIG_EXPR_DECL(SPI1CS0, SPI1PASSTHRU, COND1, SPI1PASSTHRU_DESC);
  173. SIG_EXPR_LIST_DECL(SPI1CS0, SIG_EXPR_PTR(SPI1CS0, SPI1),
  174. SIG_EXPR_PTR(SPI1CS0, SPI1DEBUG),
  175. SIG_EXPR_PTR(SPI1CS0, SPI1PASSTHRU));
  176. SIG_EXPR_LIST_DECL_SINGLE(VBCS, VGABIOSROM, COND1, VB_DESC);
  177. MS_PIN_DECL(B15, GPIOI4, SPI1CS0, VBCS);
  178. #define C15 69
  179. SIG_EXPR_DECL(SPI1CK, SPI1, COND1, SPI1_DESC);
  180. SIG_EXPR_DECL(SPI1CK, SPI1DEBUG, COND1, SPI1DEBUG_DESC);
  181. SIG_EXPR_DECL(SPI1CK, SPI1PASSTHRU, COND1, SPI1PASSTHRU_DESC);
  182. SIG_EXPR_LIST_DECL(SPI1CK, SIG_EXPR_PTR(SPI1CK, SPI1),
  183. SIG_EXPR_PTR(SPI1CK, SPI1DEBUG),
  184. SIG_EXPR_PTR(SPI1CK, SPI1PASSTHRU));
  185. SIG_EXPR_LIST_DECL_SINGLE(VBCK, VGABIOSROM, COND1, VB_DESC);
  186. MS_PIN_DECL(C15, GPIOI5, SPI1CK, VBCK);
  187. #define A14 70
  188. SIG_EXPR_DECL(SPI1MOSI, SPI1, COND1, SPI1_DESC);
  189. SIG_EXPR_DECL(SPI1MOSI, SPI1DEBUG, COND1, SPI1DEBUG_DESC);
  190. SIG_EXPR_DECL(SPI1MOSI, SPI1PASSTHRU, COND1, SPI1PASSTHRU_DESC);
  191. SIG_EXPR_LIST_DECL(SPI1MOSI, SIG_EXPR_PTR(SPI1MOSI, SPI1),
  192. SIG_EXPR_PTR(SPI1MOSI, SPI1DEBUG),
  193. SIG_EXPR_PTR(SPI1MOSI, SPI1PASSTHRU));
  194. SIG_EXPR_LIST_DECL_SINGLE(VBMOSI, VGABIOSROM, COND1, VB_DESC);
  195. MS_PIN_DECL(A14, GPIOI6, SPI1MOSI, VBMOSI);
  196. #define A15 71
  197. SIG_EXPR_DECL(SPI1MISO, SPI1, COND1, SPI1_DESC);
  198. SIG_EXPR_DECL(SPI1MISO, SPI1DEBUG, COND1, SPI1DEBUG_DESC);
  199. SIG_EXPR_DECL(SPI1MISO, SPI1PASSTHRU, COND1, SPI1PASSTHRU_DESC);
  200. SIG_EXPR_LIST_DECL(SPI1MISO, SIG_EXPR_PTR(SPI1MISO, SPI1),
  201. SIG_EXPR_PTR(SPI1MISO, SPI1DEBUG),
  202. SIG_EXPR_PTR(SPI1MISO, SPI1PASSTHRU));
  203. SIG_EXPR_LIST_DECL_SINGLE(VBMISO, VGABIOSROM, COND1, VB_DESC);
  204. MS_PIN_DECL(A15, GPIOI7, SPI1MISO, VBMISO);
  205. FUNC_GROUP_DECL(SPI1, B15, C15, A14, A15);
  206. FUNC_GROUP_DECL(SPI1DEBUG, C18, E15, B16, C16, B15, C15, A14, A15);
  207. FUNC_GROUP_DECL(SPI1PASSTHRU, C18, E15, B16, C16, B15, C15, A14, A15);
  208. FUNC_GROUP_DECL(VGABIOSROM, B15, C15, A14, A15);
  209. #define R2 72
  210. SIG_EXPR_LIST_DECL_SINGLE(SGPMCK, SGPM, SIG_DESC_SET(SCU84, 8));
  211. SS_PIN_DECL(R2, GPIOJ0, SGPMCK);
  212. #define L2 73
  213. SIG_EXPR_LIST_DECL_SINGLE(SGPMLD, SGPM, SIG_DESC_SET(SCU84, 9));
  214. SS_PIN_DECL(L2, GPIOJ1, SGPMLD);
  215. #define N3 74
  216. SIG_EXPR_LIST_DECL_SINGLE(SGPMO, SGPM, SIG_DESC_SET(SCU84, 10));
  217. SS_PIN_DECL(N3, GPIOJ2, SGPMO);
  218. #define N4 75
  219. SIG_EXPR_LIST_DECL_SINGLE(SGPMI, SGPM, SIG_DESC_SET(SCU84, 11));
  220. SS_PIN_DECL(N4, GPIOJ3, SGPMI);
  221. #define I2C5_DESC SIG_DESC_SET(SCU90, 18)
  222. #define L3 80
  223. SIG_EXPR_LIST_DECL_SINGLE(SCL5, I2C5, I2C5_DESC);
  224. SS_PIN_DECL(L3, GPIOK0, SCL5);
  225. #define L4 81
  226. SIG_EXPR_LIST_DECL_SINGLE(SDA5, I2C5, I2C5_DESC);
  227. SS_PIN_DECL(L4, GPIOK1, SDA5);
  228. FUNC_GROUP_DECL(I2C5, L3, L4);
  229. #define I2C6_DESC SIG_DESC_SET(SCU90, 19)
  230. #define L1 82
  231. SIG_EXPR_LIST_DECL_SINGLE(SCL6, I2C6, I2C6_DESC);
  232. SS_PIN_DECL(L1, GPIOK2, SCL6);
  233. #define N2 83
  234. SIG_EXPR_LIST_DECL_SINGLE(SDA6, I2C6, I2C6_DESC);
  235. SS_PIN_DECL(N2, GPIOK3, SDA6);
  236. FUNC_GROUP_DECL(I2C6, L1, N2);
  237. #define I2C7_DESC SIG_DESC_SET(SCU90, 20)
  238. #define N1 84
  239. SIG_EXPR_LIST_DECL_SINGLE(SCL7, I2C7, I2C7_DESC);
  240. SS_PIN_DECL(N1, GPIOK4, SCL7);
  241. #define P1 85
  242. SIG_EXPR_LIST_DECL_SINGLE(SDA7, I2C7, I2C7_DESC);
  243. SS_PIN_DECL(P1, GPIOK5, SDA7);
  244. FUNC_GROUP_DECL(I2C7, N1, P1);
  245. #define I2C8_DESC SIG_DESC_SET(SCU90, 21)
  246. #define P2 86
  247. SIG_EXPR_LIST_DECL_SINGLE(SCL8, I2C8, I2C8_DESC);
  248. SS_PIN_DECL(P2, GPIOK6, SCL8);
  249. #define R1 87
  250. SIG_EXPR_LIST_DECL_SINGLE(SDA8, I2C8, I2C8_DESC);
  251. SS_PIN_DECL(R1, GPIOK7, SDA8);
  252. FUNC_GROUP_DECL(I2C8, P2, R1);
  253. #define VPIOFF0_DESC { SCU90, GENMASK(5, 4), 0, 0 }
  254. #define VPIOFF1_DESC { SCU90, GENMASK(5, 4), 1, 0 }
  255. #define VPI24_DESC { SCU90, GENMASK(5, 4), 2, 0 }
  256. #define VPIRSVD_DESC { SCU90, GENMASK(5, 4), 3, 0 }
  257. #define V2 104
  258. #define V2_DESC SIG_DESC_SET(SCU88, 0)
  259. SIG_EXPR_LIST_DECL_SINGLE(DASHN0, DASHN0, VPIRSVD_DESC, V2_DESC);
  260. SIG_EXPR_LIST_DECL_SINGLE(PWM0, PWM0, V2_DESC, COND2);
  261. MS_PIN_DECL(V2, GPION0, DASHN0, PWM0);
  262. FUNC_GROUP_DECL(PWM0, V2);
  263. #define W2 105
  264. #define W2_DESC SIG_DESC_SET(SCU88, 1)
  265. SIG_EXPR_LIST_DECL_SINGLE(DASHN1, DASHN1, VPIRSVD_DESC, W2_DESC);
  266. SIG_EXPR_LIST_DECL_SINGLE(PWM1, PWM1, W2_DESC, COND2);
  267. MS_PIN_DECL(W2, GPION1, DASHN1, PWM1);
  268. FUNC_GROUP_DECL(PWM1, W2);
  269. #define V3 106
  270. #define V3_DESC SIG_DESC_SET(SCU88, 2)
  271. SIG_EXPR_DECL(VPIG2, VPI24, VPI24_DESC, V3_DESC, COND2);
  272. SIG_EXPR_DECL(VPIG2, VPIRSVD, VPIRSVD_DESC, V3_DESC, COND2);
  273. SIG_EXPR_LIST_DECL_DUAL(VPIG2, VPI24, VPIRSVD);
  274. SIG_EXPR_LIST_DECL_SINGLE(PWM2, PWM2, V3_DESC, COND2);
  275. MS_PIN_DECL(V3, GPION2, VPIG2, PWM2);
  276. FUNC_GROUP_DECL(PWM2, V3);
  277. #define U3 107
  278. #define U3_DESC SIG_DESC_SET(SCU88, 3)
  279. SIG_EXPR_DECL(VPIG3, VPI24, VPI24_DESC, U3_DESC, COND2);
  280. SIG_EXPR_DECL(VPIG3, VPIRSVD, VPIRSVD_DESC, U3_DESC, COND2);
  281. SIG_EXPR_LIST_DECL_DUAL(VPIG3, VPI24, VPIRSVD);
  282. SIG_EXPR_LIST_DECL_SINGLE(PWM3, PWM3, U3_DESC, COND2);
  283. MS_PIN_DECL(U3, GPION3, VPIG3, PWM3);
  284. FUNC_GROUP_DECL(PWM3, U3);
  285. #define W3 108
  286. #define W3_DESC SIG_DESC_SET(SCU88, 4)
  287. SIG_EXPR_DECL(VPIG4, VPI24, VPI24_DESC, W3_DESC, COND2);
  288. SIG_EXPR_DECL(VPIG4, VPIRSVD, VPIRSVD_DESC, W3_DESC, COND2);
  289. SIG_EXPR_LIST_DECL_DUAL(VPIG4, VPI24, VPIRSVD);
  290. SIG_EXPR_LIST_DECL_SINGLE(PWM4, PWM4, W3_DESC, COND2);
  291. MS_PIN_DECL(W3, GPION4, VPIG4, PWM4);
  292. FUNC_GROUP_DECL(PWM4, W3);
  293. #define AA3 109
  294. #define AA3_DESC SIG_DESC_SET(SCU88, 5)
  295. SIG_EXPR_DECL(VPIG5, VPI24, VPI24_DESC, AA3_DESC, COND2);
  296. SIG_EXPR_DECL(VPIG5, VPIRSVD, VPIRSVD_DESC, AA3_DESC, COND2);
  297. SIG_EXPR_LIST_DECL_DUAL(VPIG5, VPI24, VPIRSVD);
  298. SIG_EXPR_LIST_DECL_SINGLE(PWM5, PWM5, AA3_DESC, COND2);
  299. MS_PIN_DECL(AA3, GPION5, VPIG5, PWM5);
  300. FUNC_GROUP_DECL(PWM5, AA3);
  301. #define Y3 110
  302. #define Y3_DESC SIG_DESC_SET(SCU88, 6)
  303. SIG_EXPR_LIST_DECL_SINGLE(VPIG6, VPI24, VPI24_DESC, Y3_DESC);
  304. SIG_EXPR_LIST_DECL_SINGLE(PWM6, PWM6, Y3_DESC, COND2);
  305. MS_PIN_DECL(Y3, GPION6, VPIG6, PWM6);
  306. FUNC_GROUP_DECL(PWM6, Y3);
  307. #define T4 111
  308. #define T4_DESC SIG_DESC_SET(SCU88, 7)
  309. SIG_EXPR_LIST_DECL_SINGLE(VPIG7, VPI24, VPI24_DESC, T4_DESC);
  310. SIG_EXPR_LIST_DECL_SINGLE(PWM7, PWM7, T4_DESC, COND2);
  311. MS_PIN_DECL(T4, GPION7, VPIG7, PWM7);
  312. FUNC_GROUP_DECL(PWM7, T4);
  313. #define V6 127
  314. SIG_EXPR_LIST_DECL_SINGLE(DASHV6, DASHV6, SIG_DESC_SET(SCU90, 28),
  315. SIG_DESC_SET(SCU88, 23));
  316. SS_PIN_DECL(V6, GPIOP7, DASHV6);
  317. #define I2C3_DESC SIG_DESC_SET(SCU90, 16)
  318. #define A11 128
  319. SIG_EXPR_LIST_DECL_SINGLE(SCL3, I2C3, I2C3_DESC);
  320. SS_PIN_DECL(A11, GPIOQ0, SCL3);
  321. #define A10 129
  322. SIG_EXPR_LIST_DECL_SINGLE(SDA3, I2C3, I2C3_DESC);
  323. SS_PIN_DECL(A10, GPIOQ1, SDA3);
  324. FUNC_GROUP_DECL(I2C3, A11, A10);
  325. #define I2C4_DESC SIG_DESC_SET(SCU90, 17)
  326. #define A9 130
  327. SIG_EXPR_LIST_DECL_SINGLE(SCL4, I2C4, I2C4_DESC);
  328. SS_PIN_DECL(A9, GPIOQ2, SCL4);
  329. #define B9 131
  330. SIG_EXPR_LIST_DECL_SINGLE(SDA4, I2C4, I2C4_DESC);
  331. SS_PIN_DECL(B9, GPIOQ3, SDA4);
  332. FUNC_GROUP_DECL(I2C4, A9, B9);
  333. #define I2C14_DESC SIG_DESC_SET(SCU90, 27)
  334. #define N21 132
  335. SIG_EXPR_LIST_DECL_SINGLE(SCL14, I2C14, I2C14_DESC);
  336. SS_PIN_DECL(N21, GPIOQ4, SCL14);
  337. #define N22 133
  338. SIG_EXPR_LIST_DECL_SINGLE(SDA14, I2C14, I2C14_DESC);
  339. SS_PIN_DECL(N22, GPIOQ5, SDA14);
  340. FUNC_GROUP_DECL(I2C14, N21, N22);
  341. #define B10 134
  342. SSSF_PIN_DECL(B10, GPIOQ6, OSCCLK, SIG_DESC_SET(SCU2C, 1));
  343. #define N20 135
  344. SSSF_PIN_DECL(N20, GPIOQ7, PEWAKE, SIG_DESC_SET(SCU2C, 29));
  345. #define D8 142
  346. SIG_EXPR_LIST_DECL_SINGLE(MDC1, MDIO1, SIG_DESC_SET(SCU88, 30));
  347. SS_PIN_DECL(D8, GPIOR6, MDC1);
  348. #define E10 143
  349. SIG_EXPR_LIST_DECL_SINGLE(MDIO1, MDIO1, SIG_DESC_SET(SCU88, 31));
  350. SS_PIN_DECL(E10, GPIOR7, MDIO1);
  351. FUNC_GROUP_DECL(MDIO1, D8, E10);
  352. /* RGMII1/RMII1 */
  353. #define RMII1_DESC SIG_DESC_BIT(HW_STRAP1, 6, 0)
  354. #define RMII2_DESC SIG_DESC_BIT(HW_STRAP1, 7, 0)
  355. #define B5 152
  356. SIG_EXPR_LIST_DECL_SINGLE(GPIOT0, GPIOT0, SIG_DESC_SET(SCUA0, 0));
  357. SIG_EXPR_LIST_DECL_SINGLE(RMII1RCLKO, RMII1, RMII1_DESC,
  358. SIG_DESC_SET(SCU48, 29));
  359. SIG_EXPR_LIST_DECL_SINGLE(RGMII1TXCK, RGMII1);
  360. MS_PIN_DECL_(B5, SIG_EXPR_LIST_PTR(GPIOT0), SIG_EXPR_LIST_PTR(RMII1RCLKO),
  361. SIG_EXPR_LIST_PTR(RGMII1TXCK));
  362. #define E9 153
  363. SIG_EXPR_LIST_DECL_SINGLE(GPIOT1, GPIOT1, SIG_DESC_SET(SCUA0, 1));
  364. SIG_EXPR_LIST_DECL_SINGLE(RMII1TXEN, RMII1, RMII1_DESC);
  365. SIG_EXPR_LIST_DECL_SINGLE(RGMII1TXCTL, RGMII1);
  366. MS_PIN_DECL_(E9, SIG_EXPR_LIST_PTR(GPIOT1), SIG_EXPR_LIST_PTR(RMII1TXEN),
  367. SIG_EXPR_LIST_PTR(RGMII1TXCTL));
  368. #define F9 154
  369. SIG_EXPR_LIST_DECL_SINGLE(GPIOT2, GPIOT2, SIG_DESC_SET(SCUA0, 2));
  370. SIG_EXPR_LIST_DECL_SINGLE(RMII1TXD0, RMII1, RMII1_DESC);
  371. SIG_EXPR_LIST_DECL_SINGLE(RGMII1TXD0, RGMII1);
  372. MS_PIN_DECL_(F9, SIG_EXPR_LIST_PTR(GPIOT2), SIG_EXPR_LIST_PTR(RMII1TXD0),
  373. SIG_EXPR_LIST_PTR(RGMII1TXD0));
  374. #define A5 155
  375. SIG_EXPR_LIST_DECL_SINGLE(GPIOT3, GPIOT3, SIG_DESC_SET(SCUA0, 3));
  376. SIG_EXPR_LIST_DECL_SINGLE(RMII1TXD1, RMII1, RMII1_DESC);
  377. SIG_EXPR_LIST_DECL_SINGLE(RGMII1TXD1, RGMII1);
  378. MS_PIN_DECL_(A5, SIG_EXPR_LIST_PTR(GPIOT3), SIG_EXPR_LIST_PTR(RMII1TXD1),
  379. SIG_EXPR_LIST_PTR(RGMII1TXD1));
  380. #define E7 156
  381. SIG_EXPR_LIST_DECL_SINGLE(GPIOT4, GPIOT4, SIG_DESC_SET(SCUA0, 4));
  382. SIG_EXPR_LIST_DECL_SINGLE(RMII1DASH0, RMII1, RMII1_DESC);
  383. SIG_EXPR_LIST_DECL_SINGLE(RGMII1TXD2, RGMII1);
  384. MS_PIN_DECL_(E7, SIG_EXPR_LIST_PTR(GPIOT4), SIG_EXPR_LIST_PTR(RMII1DASH0),
  385. SIG_EXPR_LIST_PTR(RGMII1TXD2));
  386. #define D7 157
  387. SIG_EXPR_LIST_DECL_SINGLE(GPIOT5, GPIOT5, SIG_DESC_SET(SCUA0, 5));
  388. SIG_EXPR_LIST_DECL_SINGLE(RMII1DASH1, RMII1, RMII1_DESC);
  389. SIG_EXPR_LIST_DECL_SINGLE(RGMII1TXD3, RGMII1);
  390. MS_PIN_DECL_(D7, SIG_EXPR_LIST_PTR(GPIOT5), SIG_EXPR_LIST_PTR(RMII1DASH1),
  391. SIG_EXPR_LIST_PTR(RGMII1TXD3));
  392. #define B2 158
  393. SIG_EXPR_LIST_DECL_SINGLE(GPIOT6, GPIOT6, SIG_DESC_SET(SCUA0, 6));
  394. SIG_EXPR_LIST_DECL_SINGLE(RMII2RCLKO, RMII2, RMII2_DESC,
  395. SIG_DESC_SET(SCU48, 30));
  396. SIG_EXPR_LIST_DECL_SINGLE(RGMII2TXCK, RGMII2);
  397. MS_PIN_DECL_(B2, SIG_EXPR_LIST_PTR(GPIOT6), SIG_EXPR_LIST_PTR(RMII2RCLKO),
  398. SIG_EXPR_LIST_PTR(RGMII2TXCK));
  399. #define B1 159
  400. SIG_EXPR_LIST_DECL_SINGLE(GPIOT7, GPIOT7, SIG_DESC_SET(SCUA0, 7));
  401. SIG_EXPR_LIST_DECL_SINGLE(RMII2TXEN, RMII2, RMII2_DESC);
  402. SIG_EXPR_LIST_DECL_SINGLE(RGMII2TXCTL, RGMII2);
  403. MS_PIN_DECL_(B1, SIG_EXPR_LIST_PTR(GPIOT7), SIG_EXPR_LIST_PTR(RMII2TXEN),
  404. SIG_EXPR_LIST_PTR(RGMII2TXCTL));
  405. #define A2 160
  406. SIG_EXPR_LIST_DECL_SINGLE(GPIOU0, GPIOU0, SIG_DESC_SET(SCUA0, 8));
  407. SIG_EXPR_LIST_DECL_SINGLE(RMII2TXD0, RMII2, RMII2_DESC);
  408. SIG_EXPR_LIST_DECL_SINGLE(RGMII2TXD0, RGMII2);
  409. MS_PIN_DECL_(A2, SIG_EXPR_LIST_PTR(GPIOU0), SIG_EXPR_LIST_PTR(RMII2TXD0),
  410. SIG_EXPR_LIST_PTR(RGMII2TXD0));
  411. #define B3 161
  412. SIG_EXPR_LIST_DECL_SINGLE(GPIOU1, GPIOU1, SIG_DESC_SET(SCUA0, 9));
  413. SIG_EXPR_LIST_DECL_SINGLE(RMII2TXD1, RMII2, RMII2_DESC);
  414. SIG_EXPR_LIST_DECL_SINGLE(RGMII2TXD1, RGMII2);
  415. MS_PIN_DECL_(B3, SIG_EXPR_LIST_PTR(GPIOU1), SIG_EXPR_LIST_PTR(RMII2TXD1),
  416. SIG_EXPR_LIST_PTR(RGMII2TXD1));
  417. #define D5 162
  418. SIG_EXPR_LIST_DECL_SINGLE(GPIOU2, GPIOU2, SIG_DESC_SET(SCUA0, 10));
  419. SIG_EXPR_LIST_DECL_SINGLE(RMII2DASH0, RMII2, RMII2_DESC);
  420. SIG_EXPR_LIST_DECL_SINGLE(RGMII2TXD2, RGMII2);
  421. MS_PIN_DECL_(D5, SIG_EXPR_LIST_PTR(GPIOU2), SIG_EXPR_LIST_PTR(RMII2DASH0),
  422. SIG_EXPR_LIST_PTR(RGMII2TXD2));
  423. #define D4 163
  424. SIG_EXPR_LIST_DECL_SINGLE(GPIOU3, GPIOU3, SIG_DESC_SET(SCUA0, 11));
  425. SIG_EXPR_LIST_DECL_SINGLE(RMII2DASH1, RMII2, RMII2_DESC);
  426. SIG_EXPR_LIST_DECL_SINGLE(RGMII2TXD3, RGMII2);
  427. MS_PIN_DECL_(D4, SIG_EXPR_LIST_PTR(GPIOU3), SIG_EXPR_LIST_PTR(RMII2DASH1),
  428. SIG_EXPR_LIST_PTR(RGMII2TXD3));
  429. #define B4 164
  430. SIG_EXPR_LIST_DECL_SINGLE(GPIOU4, GPIOU4, SIG_DESC_SET(SCUA0, 12));
  431. SIG_EXPR_LIST_DECL_SINGLE(RMII1RCLKI, RMII1, RMII1_DESC);
  432. SIG_EXPR_LIST_DECL_SINGLE(RGMII1RXCK, RGMII1);
  433. MS_PIN_DECL_(B4, SIG_EXPR_LIST_PTR(GPIOU4), SIG_EXPR_LIST_PTR(RMII1RCLKI),
  434. SIG_EXPR_LIST_PTR(RGMII1RXCK));
  435. #define A4 165
  436. SIG_EXPR_LIST_DECL_SINGLE(GPIOU5, GPIOU5, SIG_DESC_SET(SCUA0, 13));
  437. SIG_EXPR_LIST_DECL_SINGLE(RMII1DASH2, RMII1, RMII1_DESC);
  438. SIG_EXPR_LIST_DECL_SINGLE(RGMII1RXCTL, RGMII1);
  439. MS_PIN_DECL_(A4, SIG_EXPR_LIST_PTR(GPIOU5), SIG_EXPR_LIST_PTR(RMII1DASH2),
  440. SIG_EXPR_LIST_PTR(RGMII1RXCTL));
  441. #define A3 166
  442. SIG_EXPR_LIST_DECL_SINGLE(GPIOU6, GPIOU6, SIG_DESC_SET(SCUA0, 14));
  443. SIG_EXPR_LIST_DECL_SINGLE(RMII1RXD0, RMII1, RMII1_DESC);
  444. SIG_EXPR_LIST_DECL_SINGLE(RGMII1RXD0, RGMII1);
  445. MS_PIN_DECL_(A3, SIG_EXPR_LIST_PTR(GPIOU6), SIG_EXPR_LIST_PTR(RMII1RXD0),
  446. SIG_EXPR_LIST_PTR(RGMII1RXD0));
  447. #define D6 167
  448. SIG_EXPR_LIST_DECL_SINGLE(GPIOU7, GPIOU7, SIG_DESC_SET(SCUA0, 15));
  449. SIG_EXPR_LIST_DECL_SINGLE(RMII1RXD1, RMII1, RMII1_DESC);
  450. SIG_EXPR_LIST_DECL_SINGLE(RGMII1RXD1, RGMII1);
  451. MS_PIN_DECL_(D6, SIG_EXPR_LIST_PTR(GPIOU7), SIG_EXPR_LIST_PTR(RMII1RXD1),
  452. SIG_EXPR_LIST_PTR(RGMII1RXD1));
  453. #define C5 168
  454. SIG_EXPR_LIST_DECL_SINGLE(GPIOV0, GPIOV0, SIG_DESC_SET(SCUA0, 16));
  455. SIG_EXPR_LIST_DECL_SINGLE(RMII1CRSDV, RMII1, RMII1_DESC);
  456. SIG_EXPR_LIST_DECL_SINGLE(RGMII1RXD2, RGMII1);
  457. MS_PIN_DECL_(C5, SIG_EXPR_LIST_PTR(GPIOV0), SIG_EXPR_LIST_PTR(RMII1CRSDV),
  458. SIG_EXPR_LIST_PTR(RGMII1RXD2));
  459. #define C4 169
  460. SIG_EXPR_LIST_DECL_SINGLE(GPIOV1, GPIOV1, SIG_DESC_SET(SCUA0, 17));
  461. SIG_EXPR_LIST_DECL_SINGLE(RMII1RXER, RMII1, RMII1_DESC);
  462. SIG_EXPR_LIST_DECL_SINGLE(RGMII1RXD3, RGMII1);
  463. MS_PIN_DECL_(C4, SIG_EXPR_LIST_PTR(GPIOV1), SIG_EXPR_LIST_PTR(RMII1RXER),
  464. SIG_EXPR_LIST_PTR(RGMII1RXD3));
  465. FUNC_GROUP_DECL(RGMII1, B4, A4, A3, D6, C5, C4, B5, E9, F9, A5, E7, D7);
  466. FUNC_GROUP_DECL(RMII1, B4, A3, D6, C5, C4, B5, E9, F9, A5);
  467. #define C2 170
  468. SIG_EXPR_LIST_DECL_SINGLE(GPIOV2, GPIOV2, SIG_DESC_SET(SCUA0, 18));
  469. SIG_EXPR_LIST_DECL_SINGLE(RMII2RCLKI, RMII2, RMII2_DESC);
  470. SIG_EXPR_LIST_DECL_SINGLE(RGMII2RXCK, RGMII2);
  471. MS_PIN_DECL_(C2, SIG_EXPR_LIST_PTR(GPIOV2), SIG_EXPR_LIST_PTR(RMII2RCLKI),
  472. SIG_EXPR_LIST_PTR(RGMII2RXCK));
  473. #define C1 171
  474. SIG_EXPR_LIST_DECL_SINGLE(GPIOV3, GPIOV3, SIG_DESC_SET(SCUA0, 19));
  475. SIG_EXPR_LIST_DECL_SINGLE(RMII2DASH2, RMII2, RMII2_DESC);
  476. SIG_EXPR_LIST_DECL_SINGLE(RGMII2RXCTL, RGMII2);
  477. MS_PIN_DECL_(C1, SIG_EXPR_LIST_PTR(GPIOV3), SIG_EXPR_LIST_PTR(RMII2DASH2),
  478. SIG_EXPR_LIST_PTR(RGMII2RXCTL));
  479. #define C3 172
  480. SIG_EXPR_LIST_DECL_SINGLE(GPIOV4, GPIOV4, SIG_DESC_SET(SCUA0, 20));
  481. SIG_EXPR_LIST_DECL_SINGLE(RMII2RXD0, RMII2, RMII2_DESC);
  482. SIG_EXPR_LIST_DECL_SINGLE(RGMII2RXD0, RGMII2);
  483. MS_PIN_DECL_(C3, SIG_EXPR_LIST_PTR(GPIOV4), SIG_EXPR_LIST_PTR(RMII2RXD0),
  484. SIG_EXPR_LIST_PTR(RGMII2RXD0));
  485. #define D1 173
  486. SIG_EXPR_LIST_DECL_SINGLE(GPIOV5, GPIOV5, SIG_DESC_SET(SCUA0, 21));
  487. SIG_EXPR_LIST_DECL_SINGLE(RMII2RXD1, RMII2, RMII2_DESC);
  488. SIG_EXPR_LIST_DECL_SINGLE(RGMII2RXD1, RGMII2);
  489. MS_PIN_DECL_(D1, SIG_EXPR_LIST_PTR(GPIOV5), SIG_EXPR_LIST_PTR(RMII2RXD1),
  490. SIG_EXPR_LIST_PTR(RGMII2RXD1));
  491. #define D2 174
  492. SIG_EXPR_LIST_DECL_SINGLE(GPIOV6, GPIOV6, SIG_DESC_SET(SCUA0, 22));
  493. SIG_EXPR_LIST_DECL_SINGLE(RMII2CRSDV, RMII2, RMII2_DESC);
  494. SIG_EXPR_LIST_DECL_SINGLE(RGMII2RXD2, RGMII2);
  495. MS_PIN_DECL_(D2, SIG_EXPR_LIST_PTR(GPIOV6), SIG_EXPR_LIST_PTR(RMII2CRSDV),
  496. SIG_EXPR_LIST_PTR(RGMII2RXD2));
  497. #define E6 175
  498. SIG_EXPR_LIST_DECL_SINGLE(GPIOV7, GPIOV7, SIG_DESC_SET(SCUA0, 23));
  499. SIG_EXPR_LIST_DECL_SINGLE(RMII2RXER, RMII2, RMII2_DESC);
  500. SIG_EXPR_LIST_DECL_SINGLE(RGMII2RXD3, RGMII2);
  501. MS_PIN_DECL_(E6, SIG_EXPR_LIST_PTR(GPIOV7), SIG_EXPR_LIST_PTR(RMII2RXER),
  502. SIG_EXPR_LIST_PTR(RGMII2RXD3));
  503. FUNC_GROUP_DECL(RGMII2, B2, B1, A2, B3, D5, D4, C2, C1, C3, D1, D2, E6);
  504. FUNC_GROUP_DECL(RMII2, B2, B1, A2, B3, C2, C3, D1, D2, E6);
  505. /* Pins, groups and functions are sort(1):ed alphabetically for sanity */
  506. static struct pinctrl_pin_desc aspeed_g5_pins[ASPEED_G5_NR_PINS] = {
  507. ASPEED_PINCTRL_PIN(A10),
  508. ASPEED_PINCTRL_PIN(A11),
  509. ASPEED_PINCTRL_PIN(A12),
  510. ASPEED_PINCTRL_PIN(A13),
  511. ASPEED_PINCTRL_PIN(A14),
  512. ASPEED_PINCTRL_PIN(A15),
  513. ASPEED_PINCTRL_PIN(A2),
  514. ASPEED_PINCTRL_PIN(A3),
  515. ASPEED_PINCTRL_PIN(A4),
  516. ASPEED_PINCTRL_PIN(A5),
  517. ASPEED_PINCTRL_PIN(A9),
  518. ASPEED_PINCTRL_PIN(AA3),
  519. ASPEED_PINCTRL_PIN(B1),
  520. ASPEED_PINCTRL_PIN(B10),
  521. ASPEED_PINCTRL_PIN(B11),
  522. ASPEED_PINCTRL_PIN(B12),
  523. ASPEED_PINCTRL_PIN(B13),
  524. ASPEED_PINCTRL_PIN(B14),
  525. ASPEED_PINCTRL_PIN(B15),
  526. ASPEED_PINCTRL_PIN(B16),
  527. ASPEED_PINCTRL_PIN(B2),
  528. ASPEED_PINCTRL_PIN(B20),
  529. ASPEED_PINCTRL_PIN(B3),
  530. ASPEED_PINCTRL_PIN(B4),
  531. ASPEED_PINCTRL_PIN(B5),
  532. ASPEED_PINCTRL_PIN(B9),
  533. ASPEED_PINCTRL_PIN(C1),
  534. ASPEED_PINCTRL_PIN(C11),
  535. ASPEED_PINCTRL_PIN(C12),
  536. ASPEED_PINCTRL_PIN(C13),
  537. ASPEED_PINCTRL_PIN(C14),
  538. ASPEED_PINCTRL_PIN(C15),
  539. ASPEED_PINCTRL_PIN(C16),
  540. ASPEED_PINCTRL_PIN(C18),
  541. ASPEED_PINCTRL_PIN(C2),
  542. ASPEED_PINCTRL_PIN(C20),
  543. ASPEED_PINCTRL_PIN(C3),
  544. ASPEED_PINCTRL_PIN(C4),
  545. ASPEED_PINCTRL_PIN(C5),
  546. ASPEED_PINCTRL_PIN(D1),
  547. ASPEED_PINCTRL_PIN(D10),
  548. ASPEED_PINCTRL_PIN(D2),
  549. ASPEED_PINCTRL_PIN(D20),
  550. ASPEED_PINCTRL_PIN(D4),
  551. ASPEED_PINCTRL_PIN(D5),
  552. ASPEED_PINCTRL_PIN(D6),
  553. ASPEED_PINCTRL_PIN(D7),
  554. ASPEED_PINCTRL_PIN(D8),
  555. ASPEED_PINCTRL_PIN(D9),
  556. ASPEED_PINCTRL_PIN(E10),
  557. ASPEED_PINCTRL_PIN(E12),
  558. ASPEED_PINCTRL_PIN(E13),
  559. ASPEED_PINCTRL_PIN(E15),
  560. ASPEED_PINCTRL_PIN(E21),
  561. ASPEED_PINCTRL_PIN(E6),
  562. ASPEED_PINCTRL_PIN(E7),
  563. ASPEED_PINCTRL_PIN(E9),
  564. ASPEED_PINCTRL_PIN(F19),
  565. ASPEED_PINCTRL_PIN(F20),
  566. ASPEED_PINCTRL_PIN(F9),
  567. ASPEED_PINCTRL_PIN(H20),
  568. ASPEED_PINCTRL_PIN(L1),
  569. ASPEED_PINCTRL_PIN(L2),
  570. ASPEED_PINCTRL_PIN(L3),
  571. ASPEED_PINCTRL_PIN(L4),
  572. ASPEED_PINCTRL_PIN(N1),
  573. ASPEED_PINCTRL_PIN(N2),
  574. ASPEED_PINCTRL_PIN(N20),
  575. ASPEED_PINCTRL_PIN(N21),
  576. ASPEED_PINCTRL_PIN(N22),
  577. ASPEED_PINCTRL_PIN(N3),
  578. ASPEED_PINCTRL_PIN(N4),
  579. ASPEED_PINCTRL_PIN(P1),
  580. ASPEED_PINCTRL_PIN(P2),
  581. ASPEED_PINCTRL_PIN(R1),
  582. ASPEED_PINCTRL_PIN(T4),
  583. ASPEED_PINCTRL_PIN(U3),
  584. ASPEED_PINCTRL_PIN(V2),
  585. ASPEED_PINCTRL_PIN(V3),
  586. ASPEED_PINCTRL_PIN(V6),
  587. ASPEED_PINCTRL_PIN(W2),
  588. ASPEED_PINCTRL_PIN(W3),
  589. ASPEED_PINCTRL_PIN(Y3),
  590. };
  591. static const struct aspeed_pin_group aspeed_g5_groups[] = {
  592. ASPEED_PINCTRL_GROUP(GPID0),
  593. ASPEED_PINCTRL_GROUP(GPID2),
  594. ASPEED_PINCTRL_GROUP(GPIE0),
  595. ASPEED_PINCTRL_GROUP(I2C10),
  596. ASPEED_PINCTRL_GROUP(I2C11),
  597. ASPEED_PINCTRL_GROUP(I2C12),
  598. ASPEED_PINCTRL_GROUP(I2C13),
  599. ASPEED_PINCTRL_GROUP(I2C14),
  600. ASPEED_PINCTRL_GROUP(I2C3),
  601. ASPEED_PINCTRL_GROUP(I2C4),
  602. ASPEED_PINCTRL_GROUP(I2C5),
  603. ASPEED_PINCTRL_GROUP(I2C6),
  604. ASPEED_PINCTRL_GROUP(I2C7),
  605. ASPEED_PINCTRL_GROUP(I2C8),
  606. ASPEED_PINCTRL_GROUP(I2C9),
  607. ASPEED_PINCTRL_GROUP(MAC1LINK),
  608. ASPEED_PINCTRL_GROUP(MDIO1),
  609. ASPEED_PINCTRL_GROUP(MDIO2),
  610. ASPEED_PINCTRL_GROUP(OSCCLK),
  611. ASPEED_PINCTRL_GROUP(PEWAKE),
  612. ASPEED_PINCTRL_GROUP(PWM0),
  613. ASPEED_PINCTRL_GROUP(PWM1),
  614. ASPEED_PINCTRL_GROUP(PWM2),
  615. ASPEED_PINCTRL_GROUP(PWM3),
  616. ASPEED_PINCTRL_GROUP(PWM4),
  617. ASPEED_PINCTRL_GROUP(PWM5),
  618. ASPEED_PINCTRL_GROUP(PWM6),
  619. ASPEED_PINCTRL_GROUP(PWM7),
  620. ASPEED_PINCTRL_GROUP(RGMII1),
  621. ASPEED_PINCTRL_GROUP(RGMII2),
  622. ASPEED_PINCTRL_GROUP(RMII1),
  623. ASPEED_PINCTRL_GROUP(RMII2),
  624. ASPEED_PINCTRL_GROUP(SD1),
  625. ASPEED_PINCTRL_GROUP(SPI1),
  626. ASPEED_PINCTRL_GROUP(SPI1DEBUG),
  627. ASPEED_PINCTRL_GROUP(SPI1PASSTHRU),
  628. ASPEED_PINCTRL_GROUP(TIMER4),
  629. ASPEED_PINCTRL_GROUP(TIMER5),
  630. ASPEED_PINCTRL_GROUP(TIMER6),
  631. ASPEED_PINCTRL_GROUP(TIMER7),
  632. ASPEED_PINCTRL_GROUP(TIMER8),
  633. ASPEED_PINCTRL_GROUP(VGABIOSROM),
  634. };
  635. static const struct aspeed_pin_function aspeed_g5_functions[] = {
  636. ASPEED_PINCTRL_FUNC(GPID0),
  637. ASPEED_PINCTRL_FUNC(GPID2),
  638. ASPEED_PINCTRL_FUNC(GPIE0),
  639. ASPEED_PINCTRL_FUNC(I2C10),
  640. ASPEED_PINCTRL_FUNC(I2C11),
  641. ASPEED_PINCTRL_FUNC(I2C12),
  642. ASPEED_PINCTRL_FUNC(I2C13),
  643. ASPEED_PINCTRL_FUNC(I2C14),
  644. ASPEED_PINCTRL_FUNC(I2C3),
  645. ASPEED_PINCTRL_FUNC(I2C4),
  646. ASPEED_PINCTRL_FUNC(I2C5),
  647. ASPEED_PINCTRL_FUNC(I2C6),
  648. ASPEED_PINCTRL_FUNC(I2C7),
  649. ASPEED_PINCTRL_FUNC(I2C8),
  650. ASPEED_PINCTRL_FUNC(I2C9),
  651. ASPEED_PINCTRL_FUNC(MAC1LINK),
  652. ASPEED_PINCTRL_FUNC(MDIO1),
  653. ASPEED_PINCTRL_FUNC(MDIO2),
  654. ASPEED_PINCTRL_FUNC(OSCCLK),
  655. ASPEED_PINCTRL_FUNC(PEWAKE),
  656. ASPEED_PINCTRL_FUNC(PWM0),
  657. ASPEED_PINCTRL_FUNC(PWM1),
  658. ASPEED_PINCTRL_FUNC(PWM2),
  659. ASPEED_PINCTRL_FUNC(PWM3),
  660. ASPEED_PINCTRL_FUNC(PWM4),
  661. ASPEED_PINCTRL_FUNC(PWM5),
  662. ASPEED_PINCTRL_FUNC(PWM6),
  663. ASPEED_PINCTRL_FUNC(PWM7),
  664. ASPEED_PINCTRL_FUNC(RGMII1),
  665. ASPEED_PINCTRL_FUNC(RGMII2),
  666. ASPEED_PINCTRL_FUNC(RMII1),
  667. ASPEED_PINCTRL_FUNC(RMII2),
  668. ASPEED_PINCTRL_FUNC(SD1),
  669. ASPEED_PINCTRL_FUNC(SPI1),
  670. ASPEED_PINCTRL_FUNC(SPI1DEBUG),
  671. ASPEED_PINCTRL_FUNC(SPI1PASSTHRU),
  672. ASPEED_PINCTRL_FUNC(TIMER4),
  673. ASPEED_PINCTRL_FUNC(TIMER5),
  674. ASPEED_PINCTRL_FUNC(TIMER6),
  675. ASPEED_PINCTRL_FUNC(TIMER7),
  676. ASPEED_PINCTRL_FUNC(TIMER8),
  677. ASPEED_PINCTRL_FUNC(VGABIOSROM),
  678. };
  679. static struct aspeed_pinctrl_data aspeed_g5_pinctrl_data = {
  680. .pins = aspeed_g5_pins,
  681. .npins = ARRAY_SIZE(aspeed_g5_pins),
  682. .groups = aspeed_g5_groups,
  683. .ngroups = ARRAY_SIZE(aspeed_g5_groups),
  684. .functions = aspeed_g5_functions,
  685. .nfunctions = ARRAY_SIZE(aspeed_g5_functions),
  686. };
  687. static struct pinmux_ops aspeed_g5_pinmux_ops = {
  688. .get_functions_count = aspeed_pinmux_get_fn_count,
  689. .get_function_name = aspeed_pinmux_get_fn_name,
  690. .get_function_groups = aspeed_pinmux_get_fn_groups,
  691. .set_mux = aspeed_pinmux_set_mux,
  692. .gpio_request_enable = aspeed_gpio_request_enable,
  693. .strict = true,
  694. };
  695. static struct pinctrl_ops aspeed_g5_pinctrl_ops = {
  696. .get_groups_count = aspeed_pinctrl_get_groups_count,
  697. .get_group_name = aspeed_pinctrl_get_group_name,
  698. .get_group_pins = aspeed_pinctrl_get_group_pins,
  699. .pin_dbg_show = aspeed_pinctrl_pin_dbg_show,
  700. .dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
  701. .dt_free_map = pinctrl_utils_free_map,
  702. };
  703. static struct pinctrl_desc aspeed_g5_pinctrl_desc = {
  704. .name = "aspeed-g5-pinctrl",
  705. .pins = aspeed_g5_pins,
  706. .npins = ARRAY_SIZE(aspeed_g5_pins),
  707. .pctlops = &aspeed_g5_pinctrl_ops,
  708. .pmxops = &aspeed_g5_pinmux_ops,
  709. };
  710. static int aspeed_g5_pinctrl_probe(struct platform_device *pdev)
  711. {
  712. int i;
  713. for (i = 0; i < ARRAY_SIZE(aspeed_g5_pins); i++)
  714. aspeed_g5_pins[i].number = i;
  715. return aspeed_pinctrl_probe(pdev, &aspeed_g5_pinctrl_desc,
  716. &aspeed_g5_pinctrl_data);
  717. }
  718. static const struct of_device_id aspeed_g5_pinctrl_of_match[] = {
  719. { .compatible = "aspeed,ast2500-pinctrl", },
  720. { .compatible = "aspeed,g5-pinctrl", },
  721. { },
  722. };
  723. static struct platform_driver aspeed_g5_pinctrl_driver = {
  724. .probe = aspeed_g5_pinctrl_probe,
  725. .driver = {
  726. .name = "aspeed-g5-pinctrl",
  727. .of_match_table = aspeed_g5_pinctrl_of_match,
  728. },
  729. };
  730. static int aspeed_g5_pinctrl_init(void)
  731. {
  732. return platform_driver_register(&aspeed_g5_pinctrl_driver);
  733. }
  734. arch_initcall(aspeed_g5_pinctrl_init);