1 /* 2 * Copyright (C) 2015-2017 Socionext Inc. 3 * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 */ 15 16 #include <linux/kernel.h> 17 #include <linux/init.h> 18 #include <linux/pinctrl/pinctrl.h> 19 #include <linux/platform_device.h> 20 21 #include "pinctrl-uniphier.h" 22 23 static const struct pinctrl_pin_desc uniphier_ld4_pins[] = { 24 UNIPHIER_PINCTRL_PIN(0, "EA1", UNIPHIER_PIN_IECTRL_NONE, 25 8, UNIPHIER_PIN_DRV_1BIT, 26 8, UNIPHIER_PIN_PULL_DOWN), 27 UNIPHIER_PINCTRL_PIN(1, "EA2", UNIPHIER_PIN_IECTRL_NONE, 28 9, UNIPHIER_PIN_DRV_1BIT, 29 9, UNIPHIER_PIN_PULL_DOWN), 30 UNIPHIER_PINCTRL_PIN(2, "EA3", UNIPHIER_PIN_IECTRL_NONE, 31 10, UNIPHIER_PIN_DRV_1BIT, 32 10, UNIPHIER_PIN_PULL_DOWN), 33 UNIPHIER_PINCTRL_PIN(3, "EA4", UNIPHIER_PIN_IECTRL_NONE, 34 11, UNIPHIER_PIN_DRV_1BIT, 35 11, UNIPHIER_PIN_PULL_DOWN), 36 UNIPHIER_PINCTRL_PIN(4, "EA5", UNIPHIER_PIN_IECTRL_NONE, 37 12, UNIPHIER_PIN_DRV_1BIT, 38 12, UNIPHIER_PIN_PULL_DOWN), 39 UNIPHIER_PINCTRL_PIN(5, "EA6", UNIPHIER_PIN_IECTRL_NONE, 40 13, UNIPHIER_PIN_DRV_1BIT, 41 13, UNIPHIER_PIN_PULL_DOWN), 42 UNIPHIER_PINCTRL_PIN(6, "EA7", UNIPHIER_PIN_IECTRL_NONE, 43 14, UNIPHIER_PIN_DRV_1BIT, 44 14, UNIPHIER_PIN_PULL_DOWN), 45 UNIPHIER_PINCTRL_PIN(7, "EA8", 0, 46 15, UNIPHIER_PIN_DRV_1BIT, 47 15, UNIPHIER_PIN_PULL_DOWN), 48 UNIPHIER_PINCTRL_PIN(8, "EA9", 0, 49 16, UNIPHIER_PIN_DRV_1BIT, 50 16, UNIPHIER_PIN_PULL_DOWN), 51 UNIPHIER_PINCTRL_PIN(9, "EA10", 0, 52 17, UNIPHIER_PIN_DRV_1BIT, 53 17, UNIPHIER_PIN_PULL_DOWN), 54 UNIPHIER_PINCTRL_PIN(10, "EA11", 0, 55 18, UNIPHIER_PIN_DRV_1BIT, 56 18, UNIPHIER_PIN_PULL_DOWN), 57 UNIPHIER_PINCTRL_PIN(11, "EA12", 0, 58 19, UNIPHIER_PIN_DRV_1BIT, 59 19, UNIPHIER_PIN_PULL_DOWN), 60 UNIPHIER_PINCTRL_PIN(12, "EA13", 0, 61 20, UNIPHIER_PIN_DRV_1BIT, 62 20, UNIPHIER_PIN_PULL_DOWN), 63 UNIPHIER_PINCTRL_PIN(13, "EA14", 0, 64 21, UNIPHIER_PIN_DRV_1BIT, 65 21, UNIPHIER_PIN_PULL_DOWN), 66 UNIPHIER_PINCTRL_PIN(14, "EA15", 0, 67 22, UNIPHIER_PIN_DRV_1BIT, 68 22, UNIPHIER_PIN_PULL_DOWN), 69 UNIPHIER_PINCTRL_PIN(15, "ECLK", UNIPHIER_PIN_IECTRL_NONE, 70 23, UNIPHIER_PIN_DRV_1BIT, 71 23, UNIPHIER_PIN_PULL_DOWN), 72 UNIPHIER_PINCTRL_PIN(16, "XERWE0", UNIPHIER_PIN_IECTRL_NONE, 73 24, UNIPHIER_PIN_DRV_1BIT, 74 24, UNIPHIER_PIN_PULL_UP), 75 UNIPHIER_PINCTRL_PIN(17, "XERWE1", UNIPHIER_PIN_IECTRL_NONE, 76 25, UNIPHIER_PIN_DRV_1BIT, 77 25, UNIPHIER_PIN_PULL_UP), 78 UNIPHIER_PINCTRL_PIN(18, "ES0", UNIPHIER_PIN_IECTRL_NONE, 79 27, UNIPHIER_PIN_DRV_1BIT, 80 27, UNIPHIER_PIN_PULL_UP), 81 UNIPHIER_PINCTRL_PIN(19, "ES1", UNIPHIER_PIN_IECTRL_NONE, 82 28, UNIPHIER_PIN_DRV_1BIT, 83 28, UNIPHIER_PIN_PULL_UP), 84 UNIPHIER_PINCTRL_PIN(20, "ES2", UNIPHIER_PIN_IECTRL_NONE, 85 29, UNIPHIER_PIN_DRV_1BIT, 86 29, UNIPHIER_PIN_PULL_UP), 87 UNIPHIER_PINCTRL_PIN(21, "XERST", UNIPHIER_PIN_IECTRL_NONE, 88 38, UNIPHIER_PIN_DRV_1BIT, 89 38, UNIPHIER_PIN_PULL_UP), 90 UNIPHIER_PINCTRL_PIN(22, "MMCCLK", UNIPHIER_PIN_IECTRL_NONE, 91 0, UNIPHIER_PIN_DRV_2BIT, 92 146, UNIPHIER_PIN_PULL_UP), 93 UNIPHIER_PINCTRL_PIN(23, "MMCCMD", UNIPHIER_PIN_IECTRL_NONE, 94 1, UNIPHIER_PIN_DRV_2BIT, 95 147, UNIPHIER_PIN_PULL_UP), 96 UNIPHIER_PINCTRL_PIN(24, "MMCDAT0", UNIPHIER_PIN_IECTRL_NONE, 97 2, UNIPHIER_PIN_DRV_2BIT, 98 148, UNIPHIER_PIN_PULL_UP), 99 UNIPHIER_PINCTRL_PIN(25, "MMCDAT1", UNIPHIER_PIN_IECTRL_NONE, 100 3, UNIPHIER_PIN_DRV_2BIT, 101 149, UNIPHIER_PIN_PULL_UP), 102 UNIPHIER_PINCTRL_PIN(26, "MMCDAT2", UNIPHIER_PIN_IECTRL_NONE, 103 4, UNIPHIER_PIN_DRV_2BIT, 104 150, UNIPHIER_PIN_PULL_UP), 105 UNIPHIER_PINCTRL_PIN(27, "MMCDAT3", UNIPHIER_PIN_IECTRL_NONE, 106 5, UNIPHIER_PIN_DRV_2BIT, 107 151, UNIPHIER_PIN_PULL_UP), 108 UNIPHIER_PINCTRL_PIN(28, "MMCDAT4", UNIPHIER_PIN_IECTRL_NONE, 109 6, UNIPHIER_PIN_DRV_2BIT, 110 152, UNIPHIER_PIN_PULL_UP), 111 UNIPHIER_PINCTRL_PIN(29, "MMCDAT5", UNIPHIER_PIN_IECTRL_NONE, 112 7, UNIPHIER_PIN_DRV_2BIT, 113 153, UNIPHIER_PIN_PULL_UP), 114 UNIPHIER_PINCTRL_PIN(30, "MMCDAT6", UNIPHIER_PIN_IECTRL_NONE, 115 8, UNIPHIER_PIN_DRV_2BIT, 116 154, UNIPHIER_PIN_PULL_UP), 117 UNIPHIER_PINCTRL_PIN(31, "MMCDAT7", UNIPHIER_PIN_IECTRL_NONE, 118 9, UNIPHIER_PIN_DRV_2BIT, 119 155, UNIPHIER_PIN_PULL_UP), 120 UNIPHIER_PINCTRL_PIN(32, "RMII_RXD0", 6, 121 39, UNIPHIER_PIN_DRV_1BIT, 122 39, UNIPHIER_PIN_PULL_DOWN), 123 UNIPHIER_PINCTRL_PIN(33, "RMII_RXD1", 6, 124 40, UNIPHIER_PIN_DRV_1BIT, 125 40, UNIPHIER_PIN_PULL_DOWN), 126 UNIPHIER_PINCTRL_PIN(34, "RMII_CRS_DV", 6, 127 41, UNIPHIER_PIN_DRV_1BIT, 128 41, UNIPHIER_PIN_PULL_DOWN), 129 UNIPHIER_PINCTRL_PIN(35, "RMII_RXER", 6, 130 42, UNIPHIER_PIN_DRV_1BIT, 131 42, UNIPHIER_PIN_PULL_DOWN), 132 UNIPHIER_PINCTRL_PIN(36, "RMII_REFCLK", 6, 133 43, UNIPHIER_PIN_DRV_1BIT, 134 43, UNIPHIER_PIN_PULL_DOWN), 135 UNIPHIER_PINCTRL_PIN(37, "RMII_TXD0", 6, 136 44, UNIPHIER_PIN_DRV_1BIT, 137 44, UNIPHIER_PIN_PULL_DOWN), 138 UNIPHIER_PINCTRL_PIN(38, "RMII_TXD1", 6, 139 45, UNIPHIER_PIN_DRV_1BIT, 140 45, UNIPHIER_PIN_PULL_DOWN), 141 UNIPHIER_PINCTRL_PIN(39, "RMII_TXEN", 6, 142 46, UNIPHIER_PIN_DRV_1BIT, 143 46, UNIPHIER_PIN_PULL_DOWN), 144 UNIPHIER_PINCTRL_PIN(40, "MDC", 6, 145 47, UNIPHIER_PIN_DRV_1BIT, 146 47, UNIPHIER_PIN_PULL_DOWN), 147 UNIPHIER_PINCTRL_PIN(41, "MDIO", 6, 148 48, UNIPHIER_PIN_DRV_1BIT, 149 48, UNIPHIER_PIN_PULL_DOWN), 150 UNIPHIER_PINCTRL_PIN(42, "MDIO_INTL", 6, 151 49, UNIPHIER_PIN_DRV_1BIT, 152 49, UNIPHIER_PIN_PULL_DOWN), 153 UNIPHIER_PINCTRL_PIN(43, "PHYRSTL", 6, 154 50, UNIPHIER_PIN_DRV_1BIT, 155 50, UNIPHIER_PIN_PULL_DOWN), 156 UNIPHIER_PINCTRL_PIN(44, "SDCLK", UNIPHIER_PIN_IECTRL_NONE, 157 10, UNIPHIER_PIN_DRV_2BIT, 158 156, UNIPHIER_PIN_PULL_UP), 159 UNIPHIER_PINCTRL_PIN(45, "SDCMD", UNIPHIER_PIN_IECTRL_NONE, 160 11, UNIPHIER_PIN_DRV_2BIT, 161 157, UNIPHIER_PIN_PULL_UP), 162 UNIPHIER_PINCTRL_PIN(46, "SDDAT0", UNIPHIER_PIN_IECTRL_NONE, 163 12, UNIPHIER_PIN_DRV_2BIT, 164 158, UNIPHIER_PIN_PULL_UP), 165 UNIPHIER_PINCTRL_PIN(47, "SDDAT1", UNIPHIER_PIN_IECTRL_NONE, 166 13, UNIPHIER_PIN_DRV_2BIT, 167 159, UNIPHIER_PIN_PULL_UP), 168 UNIPHIER_PINCTRL_PIN(48, "SDDAT2", UNIPHIER_PIN_IECTRL_NONE, 169 14, UNIPHIER_PIN_DRV_2BIT, 170 160, UNIPHIER_PIN_PULL_UP), 171 UNIPHIER_PINCTRL_PIN(49, "SDDAT3", UNIPHIER_PIN_IECTRL_NONE, 172 15, UNIPHIER_PIN_DRV_2BIT, 173 161, UNIPHIER_PIN_PULL_UP), 174 UNIPHIER_PINCTRL_PIN(50, "SDCD", UNIPHIER_PIN_IECTRL_NONE, 175 51, UNIPHIER_PIN_DRV_1BIT, 176 51, UNIPHIER_PIN_PULL_UP), 177 UNIPHIER_PINCTRL_PIN(51, "SDWP", UNIPHIER_PIN_IECTRL_NONE, 178 52, UNIPHIER_PIN_DRV_1BIT, 179 52, UNIPHIER_PIN_PULL_UP), 180 UNIPHIER_PINCTRL_PIN(52, "SDVOLC", UNIPHIER_PIN_IECTRL_NONE, 181 53, UNIPHIER_PIN_DRV_1BIT, 182 53, UNIPHIER_PIN_PULL_UP), 183 UNIPHIER_PINCTRL_PIN(53, "USB0VBUS", 0, 184 54, UNIPHIER_PIN_DRV_1BIT, 185 54, UNIPHIER_PIN_PULL_DOWN), 186 UNIPHIER_PINCTRL_PIN(54, "USB0OD", 0, 187 55, UNIPHIER_PIN_DRV_1BIT, 188 55, UNIPHIER_PIN_PULL_DOWN), 189 UNIPHIER_PINCTRL_PIN(55, "USB1VBUS", 0, 190 56, UNIPHIER_PIN_DRV_1BIT, 191 56, UNIPHIER_PIN_PULL_DOWN), 192 UNIPHIER_PINCTRL_PIN(56, "USB1OD", 0, 193 57, UNIPHIER_PIN_DRV_1BIT, 194 57, UNIPHIER_PIN_PULL_DOWN), 195 UNIPHIER_PINCTRL_PIN(57, "PCRESET", 0, 196 58, UNIPHIER_PIN_DRV_1BIT, 197 58, UNIPHIER_PIN_PULL_DOWN), 198 UNIPHIER_PINCTRL_PIN(58, "PCREG", 0, 199 59, UNIPHIER_PIN_DRV_1BIT, 200 59, UNIPHIER_PIN_PULL_DOWN), 201 UNIPHIER_PINCTRL_PIN(59, "PCCE2", 0, 202 60, UNIPHIER_PIN_DRV_1BIT, 203 60, UNIPHIER_PIN_PULL_DOWN), 204 UNIPHIER_PINCTRL_PIN(60, "PCVS1", 0, 205 61, UNIPHIER_PIN_DRV_1BIT, 206 61, UNIPHIER_PIN_PULL_DOWN), 207 UNIPHIER_PINCTRL_PIN(61, "PCCD2", 0, 208 62, UNIPHIER_PIN_DRV_1BIT, 209 62, UNIPHIER_PIN_PULL_DOWN), 210 UNIPHIER_PINCTRL_PIN(62, "PCCD1", 0, 211 63, UNIPHIER_PIN_DRV_1BIT, 212 63, UNIPHIER_PIN_PULL_DOWN), 213 UNIPHIER_PINCTRL_PIN(63, "PCREADY", 0, 214 64, UNIPHIER_PIN_DRV_1BIT, 215 64, UNIPHIER_PIN_PULL_DOWN), 216 UNIPHIER_PINCTRL_PIN(64, "PCDOE", 0, 217 65, UNIPHIER_PIN_DRV_1BIT, 218 65, UNIPHIER_PIN_PULL_DOWN), 219 UNIPHIER_PINCTRL_PIN(65, "PCCE1", 0, 220 66, UNIPHIER_PIN_DRV_1BIT, 221 66, UNIPHIER_PIN_PULL_DOWN), 222 UNIPHIER_PINCTRL_PIN(66, "PCWE", 0, 223 67, UNIPHIER_PIN_DRV_1BIT, 224 67, UNIPHIER_PIN_PULL_DOWN), 225 UNIPHIER_PINCTRL_PIN(67, "PCOE", 0, 226 68, UNIPHIER_PIN_DRV_1BIT, 227 68, UNIPHIER_PIN_PULL_DOWN), 228 UNIPHIER_PINCTRL_PIN(68, "PCWAIT", 0, 229 69, UNIPHIER_PIN_DRV_1BIT, 230 69, UNIPHIER_PIN_PULL_DOWN), 231 UNIPHIER_PINCTRL_PIN(69, "PCIOWR", 0, 232 70, UNIPHIER_PIN_DRV_1BIT, 233 70, UNIPHIER_PIN_PULL_DOWN), 234 UNIPHIER_PINCTRL_PIN(70, "PCIORD", 0, 235 71, UNIPHIER_PIN_DRV_1BIT, 236 71, UNIPHIER_PIN_PULL_DOWN), 237 UNIPHIER_PINCTRL_PIN(71, "HS0DIN0", 0, 238 72, UNIPHIER_PIN_DRV_1BIT, 239 72, UNIPHIER_PIN_PULL_DOWN), 240 UNIPHIER_PINCTRL_PIN(72, "HS0DIN1", 0, 241 73, UNIPHIER_PIN_DRV_1BIT, 242 73, UNIPHIER_PIN_PULL_DOWN), 243 UNIPHIER_PINCTRL_PIN(73, "HS0DIN2", 0, 244 74, UNIPHIER_PIN_DRV_1BIT, 245 74, UNIPHIER_PIN_PULL_DOWN), 246 UNIPHIER_PINCTRL_PIN(74, "HS0DIN3", 0, 247 75, UNIPHIER_PIN_DRV_1BIT, 248 75, UNIPHIER_PIN_PULL_DOWN), 249 UNIPHIER_PINCTRL_PIN(75, "HS0DIN4", 0, 250 76, UNIPHIER_PIN_DRV_1BIT, 251 76, UNIPHIER_PIN_PULL_DOWN), 252 UNIPHIER_PINCTRL_PIN(76, "HS0DIN5", 0, 253 77, UNIPHIER_PIN_DRV_1BIT, 254 77, UNIPHIER_PIN_PULL_DOWN), 255 UNIPHIER_PINCTRL_PIN(77, "HS0DIN6", 0, 256 78, UNIPHIER_PIN_DRV_1BIT, 257 78, UNIPHIER_PIN_PULL_DOWN), 258 UNIPHIER_PINCTRL_PIN(78, "HS0DIN7", 0, 259 79, UNIPHIER_PIN_DRV_1BIT, 260 79, UNIPHIER_PIN_PULL_DOWN), 261 UNIPHIER_PINCTRL_PIN(79, "HS0BCLKIN", 0, 262 80, UNIPHIER_PIN_DRV_1BIT, 263 80, UNIPHIER_PIN_PULL_DOWN), 264 UNIPHIER_PINCTRL_PIN(80, "HS0VALIN", 0, 265 81, UNIPHIER_PIN_DRV_1BIT, 266 81, UNIPHIER_PIN_PULL_DOWN), 267 UNIPHIER_PINCTRL_PIN(81, "HS0SYNCIN", 0, 268 82, UNIPHIER_PIN_DRV_1BIT, 269 82, UNIPHIER_PIN_PULL_DOWN), 270 UNIPHIER_PINCTRL_PIN(82, "HSDOUT0", 0, 271 83, UNIPHIER_PIN_DRV_1BIT, 272 83, UNIPHIER_PIN_PULL_DOWN), 273 UNIPHIER_PINCTRL_PIN(83, "HSDOUT1", 0, 274 84, UNIPHIER_PIN_DRV_1BIT, 275 84, UNIPHIER_PIN_PULL_DOWN), 276 UNIPHIER_PINCTRL_PIN(84, "HSDOUT2", 0, 277 85, UNIPHIER_PIN_DRV_1BIT, 278 85, UNIPHIER_PIN_PULL_DOWN), 279 UNIPHIER_PINCTRL_PIN(85, "HSDOUT3", 0, 280 86, UNIPHIER_PIN_DRV_1BIT, 281 86, UNIPHIER_PIN_PULL_DOWN), 282 UNIPHIER_PINCTRL_PIN(86, "HSDOUT4", 0, 283 87, UNIPHIER_PIN_DRV_1BIT, 284 87, UNIPHIER_PIN_PULL_DOWN), 285 UNIPHIER_PINCTRL_PIN(87, "HSDOUT5", 0, 286 88, UNIPHIER_PIN_DRV_1BIT, 287 88, UNIPHIER_PIN_PULL_DOWN), 288 UNIPHIER_PINCTRL_PIN(88, "HSDOUT6", 0, 289 89, UNIPHIER_PIN_DRV_1BIT, 290 89, UNIPHIER_PIN_PULL_DOWN), 291 UNIPHIER_PINCTRL_PIN(89, "HSDOUT7", 0, 292 90, UNIPHIER_PIN_DRV_1BIT, 293 90, UNIPHIER_PIN_PULL_DOWN), 294 UNIPHIER_PINCTRL_PIN(90, "HSBCLKOUT", 0, 295 91, UNIPHIER_PIN_DRV_1BIT, 296 91, UNIPHIER_PIN_PULL_DOWN), 297 UNIPHIER_PINCTRL_PIN(91, "HSVALOUT", 0, 298 92, UNIPHIER_PIN_DRV_1BIT, 299 92, UNIPHIER_PIN_PULL_DOWN), 300 UNIPHIER_PINCTRL_PIN(92, "HSSYNCOUT", 0, 301 93, UNIPHIER_PIN_DRV_1BIT, 302 93, UNIPHIER_PIN_PULL_DOWN), 303 UNIPHIER_PINCTRL_PIN(93, "AGCI", 3, 304 -1, UNIPHIER_PIN_DRV_FIXED4, 305 162, UNIPHIER_PIN_PULL_DOWN), 306 UNIPHIER_PINCTRL_PIN(94, "AGCR", 4, 307 -1, UNIPHIER_PIN_DRV_FIXED4, 308 163, UNIPHIER_PIN_PULL_DOWN), 309 UNIPHIER_PINCTRL_PIN(95, "AGCBS", 5, 310 -1, UNIPHIER_PIN_DRV_FIXED4, 311 164, UNIPHIER_PIN_PULL_DOWN), 312 UNIPHIER_PINCTRL_PIN(96, "IECOUT", 0, 313 94, UNIPHIER_PIN_DRV_1BIT, 314 94, UNIPHIER_PIN_PULL_DOWN), 315 UNIPHIER_PINCTRL_PIN(97, "ASMCK", 0, 316 95, UNIPHIER_PIN_DRV_1BIT, 317 95, UNIPHIER_PIN_PULL_DOWN), 318 UNIPHIER_PINCTRL_PIN(98, "ABCKO", UNIPHIER_PIN_IECTRL_NONE, 319 96, UNIPHIER_PIN_DRV_1BIT, 320 96, UNIPHIER_PIN_PULL_DOWN), 321 UNIPHIER_PINCTRL_PIN(99, "ALRCKO", UNIPHIER_PIN_IECTRL_NONE, 322 97, UNIPHIER_PIN_DRV_1BIT, 323 97, UNIPHIER_PIN_PULL_DOWN), 324 UNIPHIER_PINCTRL_PIN(100, "ASDOUT0", UNIPHIER_PIN_IECTRL_NONE, 325 98, UNIPHIER_PIN_DRV_1BIT, 326 98, UNIPHIER_PIN_PULL_DOWN), 327 UNIPHIER_PINCTRL_PIN(101, "ARCOUT", 0, 328 99, UNIPHIER_PIN_DRV_1BIT, 329 99, UNIPHIER_PIN_PULL_DOWN), 330 UNIPHIER_PINCTRL_PIN(102, "SDA0", UNIPHIER_PIN_IECTRL_NONE, 331 -1, UNIPHIER_PIN_DRV_FIXED4, 332 -1, UNIPHIER_PIN_PULL_NONE), 333 UNIPHIER_PINCTRL_PIN(103, "SCL0", UNIPHIER_PIN_IECTRL_NONE, 334 -1, UNIPHIER_PIN_DRV_FIXED4, 335 -1, UNIPHIER_PIN_PULL_NONE), 336 UNIPHIER_PINCTRL_PIN(104, "SDA1", UNIPHIER_PIN_IECTRL_NONE, 337 -1, UNIPHIER_PIN_DRV_FIXED4, 338 -1, UNIPHIER_PIN_PULL_NONE), 339 UNIPHIER_PINCTRL_PIN(105, "SCL1", UNIPHIER_PIN_IECTRL_NONE, 340 -1, UNIPHIER_PIN_DRV_FIXED4, 341 -1, UNIPHIER_PIN_PULL_NONE), 342 UNIPHIER_PINCTRL_PIN(106, "DMDSDA0", UNIPHIER_PIN_IECTRL_NONE, 343 -1, UNIPHIER_PIN_DRV_FIXED4, 344 -1, UNIPHIER_PIN_PULL_NONE), 345 UNIPHIER_PINCTRL_PIN(107, "DMDSCL0", UNIPHIER_PIN_IECTRL_NONE, 346 -1, UNIPHIER_PIN_DRV_FIXED4, 347 -1, UNIPHIER_PIN_PULL_NONE), 348 UNIPHIER_PINCTRL_PIN(108, "DMDSDA1", UNIPHIER_PIN_IECTRL_NONE, 349 -1, UNIPHIER_PIN_DRV_FIXED4, 350 -1, UNIPHIER_PIN_PULL_NONE), 351 UNIPHIER_PINCTRL_PIN(109, "DMDSCL1", UNIPHIER_PIN_IECTRL_NONE, 352 -1, UNIPHIER_PIN_DRV_FIXED4, 353 -1, UNIPHIER_PIN_PULL_NONE), 354 UNIPHIER_PINCTRL_PIN(110, "SBO0", UNIPHIER_PIN_IECTRL_NONE, 355 100, UNIPHIER_PIN_DRV_1BIT, 356 100, UNIPHIER_PIN_PULL_UP), 357 UNIPHIER_PINCTRL_PIN(111, "SBI0", UNIPHIER_PIN_IECTRL_NONE, 358 101, UNIPHIER_PIN_DRV_1BIT, 359 101, UNIPHIER_PIN_PULL_UP), 360 UNIPHIER_PINCTRL_PIN(112, "HIN", 1, 361 -1, UNIPHIER_PIN_DRV_FIXED5, 362 -1, UNIPHIER_PIN_PULL_NONE), 363 UNIPHIER_PINCTRL_PIN(113, "VIN", 2, 364 -1, UNIPHIER_PIN_DRV_FIXED5, 365 -1, UNIPHIER_PIN_PULL_NONE), 366 UNIPHIER_PINCTRL_PIN(114, "TCON0", UNIPHIER_PIN_IECTRL_NONE, 367 102, UNIPHIER_PIN_DRV_1BIT, 368 102, UNIPHIER_PIN_PULL_DOWN), 369 UNIPHIER_PINCTRL_PIN(115, "TCON1", UNIPHIER_PIN_IECTRL_NONE, 370 103, UNIPHIER_PIN_DRV_1BIT, 371 103, UNIPHIER_PIN_PULL_DOWN), 372 UNIPHIER_PINCTRL_PIN(116, "TCON2", UNIPHIER_PIN_IECTRL_NONE, 373 104, UNIPHIER_PIN_DRV_1BIT, 374 104, UNIPHIER_PIN_PULL_DOWN), 375 UNIPHIER_PINCTRL_PIN(117, "TCON3", UNIPHIER_PIN_IECTRL_NONE, 376 105, UNIPHIER_PIN_DRV_1BIT, 377 105, UNIPHIER_PIN_PULL_DOWN), 378 UNIPHIER_PINCTRL_PIN(118, "TCON4", UNIPHIER_PIN_IECTRL_NONE, 379 106, UNIPHIER_PIN_DRV_1BIT, 380 106, UNIPHIER_PIN_PULL_DOWN), 381 UNIPHIER_PINCTRL_PIN(119, "TCON5", UNIPHIER_PIN_IECTRL_NONE, 382 107, UNIPHIER_PIN_DRV_1BIT, 383 107, UNIPHIER_PIN_PULL_DOWN), 384 UNIPHIER_PINCTRL_PIN(120, "TCON6", 0, 385 108, UNIPHIER_PIN_DRV_1BIT, 386 108, UNIPHIER_PIN_PULL_DOWN), 387 UNIPHIER_PINCTRL_PIN(121, "TCON7", 0, 388 109, UNIPHIER_PIN_DRV_1BIT, 389 109, UNIPHIER_PIN_PULL_DOWN), 390 UNIPHIER_PINCTRL_PIN(122, "PWMA", 0, 391 110, UNIPHIER_PIN_DRV_1BIT, 392 110, UNIPHIER_PIN_PULL_DOWN), 393 UNIPHIER_PINCTRL_PIN(123, "XIRQ1", 0, 394 111, UNIPHIER_PIN_DRV_1BIT, 395 111, UNIPHIER_PIN_PULL_DOWN), 396 UNIPHIER_PINCTRL_PIN(124, "XIRQ2", 0, 397 112, UNIPHIER_PIN_DRV_1BIT, 398 112, UNIPHIER_PIN_PULL_DOWN), 399 UNIPHIER_PINCTRL_PIN(125, "XIRQ3", 0, 400 113, UNIPHIER_PIN_DRV_1BIT, 401 113, UNIPHIER_PIN_PULL_DOWN), 402 UNIPHIER_PINCTRL_PIN(126, "XIRQ4", 0, 403 114, UNIPHIER_PIN_DRV_1BIT, 404 114, UNIPHIER_PIN_PULL_DOWN), 405 UNIPHIER_PINCTRL_PIN(127, "XIRQ5", 0, 406 115, UNIPHIER_PIN_DRV_1BIT, 407 115, UNIPHIER_PIN_PULL_DOWN), 408 UNIPHIER_PINCTRL_PIN(128, "XIRQ6", 0, 409 116, UNIPHIER_PIN_DRV_1BIT, 410 116, UNIPHIER_PIN_PULL_DOWN), 411 UNIPHIER_PINCTRL_PIN(129, "XIRQ7", 0, 412 117, UNIPHIER_PIN_DRV_1BIT, 413 117, UNIPHIER_PIN_PULL_DOWN), 414 UNIPHIER_PINCTRL_PIN(130, "XIRQ8", 0, 415 118, UNIPHIER_PIN_DRV_1BIT, 416 118, UNIPHIER_PIN_PULL_DOWN), 417 UNIPHIER_PINCTRL_PIN(131, "XIRQ9", 0, 418 119, UNIPHIER_PIN_DRV_1BIT, 419 119, UNIPHIER_PIN_PULL_DOWN), 420 UNIPHIER_PINCTRL_PIN(132, "XIRQ10", 0, 421 120, UNIPHIER_PIN_DRV_1BIT, 422 120, UNIPHIER_PIN_PULL_DOWN), 423 UNIPHIER_PINCTRL_PIN(133, "XIRQ11", 0, 424 121, UNIPHIER_PIN_DRV_1BIT, 425 121, UNIPHIER_PIN_PULL_DOWN), 426 UNIPHIER_PINCTRL_PIN(134, "XIRQ14", 0, 427 122, UNIPHIER_PIN_DRV_1BIT, 428 122, UNIPHIER_PIN_PULL_DOWN), 429 UNIPHIER_PINCTRL_PIN(135, "PORT00", 0, 430 123, UNIPHIER_PIN_DRV_1BIT, 431 123, UNIPHIER_PIN_PULL_DOWN), 432 UNIPHIER_PINCTRL_PIN(136, "PORT01", 0, 433 124, UNIPHIER_PIN_DRV_1BIT, 434 124, UNIPHIER_PIN_PULL_DOWN), 435 UNIPHIER_PINCTRL_PIN(137, "PORT02", 0, 436 125, UNIPHIER_PIN_DRV_1BIT, 437 125, UNIPHIER_PIN_PULL_DOWN), 438 UNIPHIER_PINCTRL_PIN(138, "PORT03", 0, 439 126, UNIPHIER_PIN_DRV_1BIT, 440 126, UNIPHIER_PIN_PULL_DOWN), 441 UNIPHIER_PINCTRL_PIN(139, "PORT04", 0, 442 127, UNIPHIER_PIN_DRV_1BIT, 443 127, UNIPHIER_PIN_PULL_DOWN), 444 UNIPHIER_PINCTRL_PIN(140, "PORT05", 0, 445 128, UNIPHIER_PIN_DRV_1BIT, 446 128, UNIPHIER_PIN_PULL_DOWN), 447 UNIPHIER_PINCTRL_PIN(141, "PORT06", 0, 448 129, UNIPHIER_PIN_DRV_1BIT, 449 129, UNIPHIER_PIN_PULL_DOWN), 450 UNIPHIER_PINCTRL_PIN(142, "PORT07", 0, 451 130, UNIPHIER_PIN_DRV_1BIT, 452 130, UNIPHIER_PIN_PULL_DOWN), 453 UNIPHIER_PINCTRL_PIN(143, "PORT10", 0, 454 131, UNIPHIER_PIN_DRV_1BIT, 455 131, UNIPHIER_PIN_PULL_DOWN), 456 UNIPHIER_PINCTRL_PIN(144, "PORT11", 0, 457 132, UNIPHIER_PIN_DRV_1BIT, 458 132, UNIPHIER_PIN_PULL_DOWN), 459 UNIPHIER_PINCTRL_PIN(145, "PORT12", 0, 460 133, UNIPHIER_PIN_DRV_1BIT, 461 133, UNIPHIER_PIN_PULL_DOWN), 462 UNIPHIER_PINCTRL_PIN(146, "PORT13", 0, 463 134, UNIPHIER_PIN_DRV_1BIT, 464 134, UNIPHIER_PIN_PULL_DOWN), 465 UNIPHIER_PINCTRL_PIN(147, "PORT14", 0, 466 135, UNIPHIER_PIN_DRV_1BIT, 467 135, UNIPHIER_PIN_PULL_DOWN), 468 UNIPHIER_PINCTRL_PIN(148, "PORT15", 0, 469 136, UNIPHIER_PIN_DRV_1BIT, 470 136, UNIPHIER_PIN_PULL_DOWN), 471 UNIPHIER_PINCTRL_PIN(149, "PORT16", 0, 472 137, UNIPHIER_PIN_DRV_1BIT, 473 137, UNIPHIER_PIN_PULL_DOWN), 474 UNIPHIER_PINCTRL_PIN(150, "PORT17", UNIPHIER_PIN_IECTRL_NONE, 475 138, UNIPHIER_PIN_DRV_1BIT, 476 138, UNIPHIER_PIN_PULL_DOWN), 477 UNIPHIER_PINCTRL_PIN(151, "PORT20", 0, 478 139, UNIPHIER_PIN_DRV_1BIT, 479 139, UNIPHIER_PIN_PULL_DOWN), 480 UNIPHIER_PINCTRL_PIN(152, "PORT21", 0, 481 140, UNIPHIER_PIN_DRV_1BIT, 482 140, UNIPHIER_PIN_PULL_DOWN), 483 UNIPHIER_PINCTRL_PIN(153, "PORT22", 0, 484 141, UNIPHIER_PIN_DRV_1BIT, 485 141, UNIPHIER_PIN_PULL_DOWN), 486 UNIPHIER_PINCTRL_PIN(154, "PORT23", 0, 487 142, UNIPHIER_PIN_DRV_1BIT, 488 142, UNIPHIER_PIN_PULL_DOWN), 489 UNIPHIER_PINCTRL_PIN(155, "PORT24", UNIPHIER_PIN_IECTRL_NONE, 490 143, UNIPHIER_PIN_DRV_1BIT, 491 143, UNIPHIER_PIN_PULL_DOWN), 492 UNIPHIER_PINCTRL_PIN(156, "PORT25", 0, 493 144, UNIPHIER_PIN_DRV_1BIT, 494 144, UNIPHIER_PIN_PULL_DOWN), 495 UNIPHIER_PINCTRL_PIN(157, "PORT26", 0, 496 145, UNIPHIER_PIN_DRV_1BIT, 497 145, UNIPHIER_PIN_PULL_DOWN), 498 UNIPHIER_PINCTRL_PIN(158, "XNFRE", UNIPHIER_PIN_IECTRL_NONE, 499 31, UNIPHIER_PIN_DRV_1BIT, 500 31, UNIPHIER_PIN_PULL_UP), 501 UNIPHIER_PINCTRL_PIN(159, "XNFWE", UNIPHIER_PIN_IECTRL_NONE, 502 32, UNIPHIER_PIN_DRV_1BIT, 503 32, UNIPHIER_PIN_PULL_UP), 504 UNIPHIER_PINCTRL_PIN(160, "NFALE", UNIPHIER_PIN_IECTRL_NONE, 505 33, UNIPHIER_PIN_DRV_1BIT, 506 33, UNIPHIER_PIN_PULL_DOWN), 507 UNIPHIER_PINCTRL_PIN(161, "NFCLE", UNIPHIER_PIN_IECTRL_NONE, 508 34, UNIPHIER_PIN_DRV_1BIT, 509 34, UNIPHIER_PIN_PULL_DOWN), 510 UNIPHIER_PINCTRL_PIN(162, "XNFWP", UNIPHIER_PIN_IECTRL_NONE, 511 35, UNIPHIER_PIN_DRV_1BIT, 512 35, UNIPHIER_PIN_PULL_DOWN), 513 UNIPHIER_PINCTRL_PIN(163, "XNFCE0", UNIPHIER_PIN_IECTRL_NONE, 514 36, UNIPHIER_PIN_DRV_1BIT, 515 36, UNIPHIER_PIN_PULL_UP), 516 UNIPHIER_PINCTRL_PIN(164, "NANDRYBY0", UNIPHIER_PIN_IECTRL_NONE, 517 37, UNIPHIER_PIN_DRV_1BIT, 518 37, UNIPHIER_PIN_PULL_UP), 519 /* dedicated pins */ 520 UNIPHIER_PINCTRL_PIN(165, "ED0", -1, 521 0, UNIPHIER_PIN_DRV_1BIT, 522 0, UNIPHIER_PIN_PULL_DOWN), 523 UNIPHIER_PINCTRL_PIN(166, "ED1", -1, 524 1, UNIPHIER_PIN_DRV_1BIT, 525 1, UNIPHIER_PIN_PULL_DOWN), 526 UNIPHIER_PINCTRL_PIN(167, "ED2", -1, 527 2, UNIPHIER_PIN_DRV_1BIT, 528 2, UNIPHIER_PIN_PULL_DOWN), 529 UNIPHIER_PINCTRL_PIN(168, "ED3", -1, 530 3, UNIPHIER_PIN_DRV_1BIT, 531 3, UNIPHIER_PIN_PULL_DOWN), 532 UNIPHIER_PINCTRL_PIN(169, "ED4", -1, 533 4, UNIPHIER_PIN_DRV_1BIT, 534 4, UNIPHIER_PIN_PULL_DOWN), 535 UNIPHIER_PINCTRL_PIN(170, "ED5", -1, 536 5, UNIPHIER_PIN_DRV_1BIT, 537 5, UNIPHIER_PIN_PULL_DOWN), 538 UNIPHIER_PINCTRL_PIN(171, "ED6", -1, 539 6, UNIPHIER_PIN_DRV_1BIT, 540 6, UNIPHIER_PIN_PULL_DOWN), 541 UNIPHIER_PINCTRL_PIN(172, "ED7", -1, 542 7, UNIPHIER_PIN_DRV_1BIT, 543 7, UNIPHIER_PIN_PULL_DOWN), 544 UNIPHIER_PINCTRL_PIN(173, "ERXW", -1, 545 26, UNIPHIER_PIN_DRV_1BIT, 546 26, UNIPHIER_PIN_PULL_UP), 547 UNIPHIER_PINCTRL_PIN(174, "XECS1", -1, 548 30, UNIPHIER_PIN_DRV_1BIT, 549 30, UNIPHIER_PIN_PULL_UP), 550 }; 551 552 static const unsigned emmc_pins[] = {21, 22, 23, 24, 25, 26, 27}; 553 static const int emmc_muxvals[] = {0, 1, 1, 1, 1, 1, 1}; 554 static const unsigned emmc_dat8_pins[] = {28, 29, 30, 31}; 555 static const int emmc_dat8_muxvals[] = {1, 1, 1, 1}; 556 static const unsigned ether_mii_pins[] = {32, 33, 34, 35, 36, 37, 38, 39, 40, 557 41, 42, 43, 136, 137, 138, 139, 140, 558 141, 142}; 559 static const int ether_mii_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 560 4, 4, 4, 4, 4, 4, 4}; 561 static const unsigned ether_rmii_pins[] = {32, 33, 34, 35, 36, 37, 38, 39, 40, 562 41, 42, 43}; 563 static const int ether_rmii_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 564 static const unsigned i2c0_pins[] = {102, 103}; 565 static const int i2c0_muxvals[] = {0, 0}; 566 static const unsigned i2c1_pins[] = {104, 105}; 567 static const int i2c1_muxvals[] = {0, 0}; 568 static const unsigned i2c2_pins[] = {108, 109}; 569 static const int i2c2_muxvals[] = {2, 2}; 570 static const unsigned i2c3_pins[] = {108, 109}; 571 static const int i2c3_muxvals[] = {3, 3}; 572 static const unsigned nand_pins[] = {24, 25, 26, 27, 28, 29, 30, 31, 158, 159, 573 160, 161, 162, 163, 164}; 574 static const int nand_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 575 static const unsigned nand_cs1_pins[] = {22, 23}; 576 static const int nand_cs1_muxvals[] = {0, 0}; 577 static const unsigned sd_pins[] = {44, 45, 46, 47, 48, 49, 50, 51, 52}; 578 static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; 579 static const unsigned system_bus_pins[] = {16, 17, 18, 19, 20, 165, 166, 167, 580 168, 169, 170, 171, 172, 173}; 581 static const int system_bus_muxvals[] = {0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 582 -1, -1, -1}; 583 static const unsigned system_bus_cs0_pins[] = {155}; 584 static const int system_bus_cs0_muxvals[] = {1}; 585 static const unsigned system_bus_cs1_pins[] = {174}; 586 static const int system_bus_cs1_muxvals[] = {-1}; 587 static const unsigned system_bus_cs2_pins[] = {64}; 588 static const int system_bus_cs2_muxvals[] = {1}; 589 static const unsigned system_bus_cs3_pins[] = {156}; 590 static const int system_bus_cs3_muxvals[] = {1}; 591 static const unsigned uart0_pins[] = {85, 88}; 592 static const int uart0_muxvals[] = {1, 1}; 593 static const unsigned uart1_pins[] = {155, 156}; 594 static const int uart1_muxvals[] = {13, 13}; 595 static const unsigned uart1b_pins[] = {69, 70}; 596 static const int uart1b_muxvals[] = {23, 23}; 597 static const unsigned uart2_pins[] = {128, 129}; 598 static const int uart2_muxvals[] = {13, 13}; 599 static const unsigned uart3_pins[] = {110, 111}; 600 static const int uart3_muxvals[] = {1, 1}; 601 static const unsigned usb0_pins[] = {53, 54}; 602 static const int usb0_muxvals[] = {0, 0}; 603 static const unsigned usb1_pins[] = {55, 56}; 604 static const int usb1_muxvals[] = {0, 0}; 605 static const unsigned usb2_pins[] = {155, 156}; 606 static const int usb2_muxvals[] = {4, 4}; 607 static const unsigned usb2b_pins[] = {67, 68}; 608 static const int usb2b_muxvals[] = {23, 23}; 609 static const unsigned port_range0_pins[] = { 610 135, 136, 137, 138, 139, 140, 141, 142, /* PORT0x */ 611 143, 144, 145, 146, 147, 148, 149, 150, /* PORT1x */ 612 151, 152, 153, 154, 155, 156, 157, 0, /* PORT2x */ 613 1, 2, 3, 4, 5, 120, 121, 122, /* PORT3x */ 614 24, 25, 26, 27, 28, 29, 30, 31, /* PORT4x */ 615 40, 41, 42, 43, 44, 45, 46, 47, /* PORT5x */ 616 48, 49, 50, 51, 52, 53, 54, 55, /* PORT6x */ 617 56, 85, 84, 59, 82, 61, 64, 65, /* PORT7x */ 618 8, 9, 10, 11, 12, 13, 14, 15, /* PORT8x */ 619 66, 67, 68, 69, 70, 71, 72, 73, /* PORT9x */ 620 74, 75, 89, 86, 78, 79, 80, 81, /* PORT10x */ 621 60, 83, 58, 57, 88, 87, 77, 76, /* PORT11x */ 622 90, 91, 92, 93, 94, 95, 96, 97, /* PORT12x */ 623 98, 99, 100, 6, 101, 114, 115, 116, /* PORT13x */ 624 103, 108, 21, 22, 23, 117, 118, 119, /* PORT14x */ 625 }; 626 static const int port_range0_muxvals[] = { 627 0, 0, 0, 0, 0, 0, 0, 0, /* PORT0x */ 628 0, 0, 0, 0, 0, 0, 0, 0, /* PORT1x */ 629 0, 0, 0, 0, 0, 0, 0, 15, /* PORT2x */ 630 15, 15, 15, 15, 15, 15, 15, 15, /* PORT3x */ 631 15, 15, 15, 15, 15, 15, 15, 15, /* PORT4x */ 632 15, 15, 15, 15, 15, 15, 15, 15, /* PORT5x */ 633 15, 15, 15, 15, 15, 15, 15, 15, /* PORT6x */ 634 15, 15, 15, 15, 15, 15, 15, 15, /* PORT7x */ 635 15, 15, 15, 15, 15, 15, 15, 15, /* PORT8x */ 636 15, 15, 15, 15, 15, 15, 15, 15, /* PORT9x */ 637 15, 15, 15, 15, 15, 15, 15, 15, /* PORT10x */ 638 15, 15, 15, 15, 15, 15, 15, 15, /* PORT11x */ 639 15, 15, 15, 15, 15, 15, 15, 15, /* PORT12x */ 640 15, 15, 15, 15, 15, 15, 15, 15, /* PORT13x */ 641 15, 15, 15, 15, 15, 15, 15, 15, /* PORT14x */ 642 }; 643 static const unsigned port_range1_pins[] = { 644 7, /* PORT166 */ 645 }; 646 static const int port_range1_muxvals[] = { 647 15, /* PORT166 */ 648 }; 649 static const unsigned xirq_range0_pins[] = { 650 151, 123, 124, 125, 126, 127, 128, 129, /* XIRQ0-7 */ 651 130, 131, 132, 133, 62, /* XIRQ8-12 */ 652 }; 653 static const int xirq_range0_muxvals[] = { 654 14, 0, 0, 0, 0, 0, 0, 0, /* XIRQ0-7 */ 655 0, 0, 0, 0, 14, /* XIRQ8-12 */ 656 }; 657 static const unsigned xirq_range1_pins[] = { 658 134, 63, /* XIRQ14-15 */ 659 }; 660 static const int xirq_range1_muxvals[] = { 661 0, 14, /* XIRQ14-15 */ 662 }; 663 664 static const struct uniphier_pinctrl_group uniphier_ld4_groups[] = { 665 UNIPHIER_PINCTRL_GROUP(emmc), 666 UNIPHIER_PINCTRL_GROUP(emmc_dat8), 667 UNIPHIER_PINCTRL_GROUP(ether_mii), 668 UNIPHIER_PINCTRL_GROUP(ether_rmii), 669 UNIPHIER_PINCTRL_GROUP(i2c0), 670 UNIPHIER_PINCTRL_GROUP(i2c1), 671 UNIPHIER_PINCTRL_GROUP(i2c2), 672 UNIPHIER_PINCTRL_GROUP(i2c3), 673 UNIPHIER_PINCTRL_GROUP(nand), 674 UNIPHIER_PINCTRL_GROUP(nand_cs1), 675 UNIPHIER_PINCTRL_GROUP(sd), 676 UNIPHIER_PINCTRL_GROUP(system_bus), 677 UNIPHIER_PINCTRL_GROUP(system_bus_cs0), 678 UNIPHIER_PINCTRL_GROUP(system_bus_cs1), 679 UNIPHIER_PINCTRL_GROUP(system_bus_cs2), 680 UNIPHIER_PINCTRL_GROUP(system_bus_cs3), 681 UNIPHIER_PINCTRL_GROUP(uart0), 682 UNIPHIER_PINCTRL_GROUP(uart1), 683 UNIPHIER_PINCTRL_GROUP(uart1b), 684 UNIPHIER_PINCTRL_GROUP(uart2), 685 UNIPHIER_PINCTRL_GROUP(uart3), 686 UNIPHIER_PINCTRL_GROUP(usb0), 687 UNIPHIER_PINCTRL_GROUP(usb1), 688 UNIPHIER_PINCTRL_GROUP(usb2), 689 UNIPHIER_PINCTRL_GROUP(usb2b), 690 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range0), 691 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range1), 692 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq_range0), 693 UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq_range1), 694 UNIPHIER_PINCTRL_GROUP_SINGLE(port00, port_range0, 0), 695 UNIPHIER_PINCTRL_GROUP_SINGLE(port01, port_range0, 1), 696 UNIPHIER_PINCTRL_GROUP_SINGLE(port02, port_range0, 2), 697 UNIPHIER_PINCTRL_GROUP_SINGLE(port03, port_range0, 3), 698 UNIPHIER_PINCTRL_GROUP_SINGLE(port04, port_range0, 4), 699 UNIPHIER_PINCTRL_GROUP_SINGLE(port05, port_range0, 5), 700 UNIPHIER_PINCTRL_GROUP_SINGLE(port06, port_range0, 6), 701 UNIPHIER_PINCTRL_GROUP_SINGLE(port07, port_range0, 7), 702 UNIPHIER_PINCTRL_GROUP_SINGLE(port10, port_range0, 8), 703 UNIPHIER_PINCTRL_GROUP_SINGLE(port11, port_range0, 9), 704 UNIPHIER_PINCTRL_GROUP_SINGLE(port12, port_range0, 10), 705 UNIPHIER_PINCTRL_GROUP_SINGLE(port13, port_range0, 11), 706 UNIPHIER_PINCTRL_GROUP_SINGLE(port14, port_range0, 12), 707 UNIPHIER_PINCTRL_GROUP_SINGLE(port15, port_range0, 13), 708 UNIPHIER_PINCTRL_GROUP_SINGLE(port16, port_range0, 14), 709 UNIPHIER_PINCTRL_GROUP_SINGLE(port17, port_range0, 15), 710 UNIPHIER_PINCTRL_GROUP_SINGLE(port20, port_range0, 16), 711 UNIPHIER_PINCTRL_GROUP_SINGLE(port21, port_range0, 17), 712 UNIPHIER_PINCTRL_GROUP_SINGLE(port22, port_range0, 18), 713 UNIPHIER_PINCTRL_GROUP_SINGLE(port23, port_range0, 19), 714 UNIPHIER_PINCTRL_GROUP_SINGLE(port24, port_range0, 20), 715 UNIPHIER_PINCTRL_GROUP_SINGLE(port25, port_range0, 21), 716 UNIPHIER_PINCTRL_GROUP_SINGLE(port26, port_range0, 22), 717 UNIPHIER_PINCTRL_GROUP_SINGLE(port27, port_range0, 23), 718 UNIPHIER_PINCTRL_GROUP_SINGLE(port30, port_range0, 24), 719 UNIPHIER_PINCTRL_GROUP_SINGLE(port31, port_range0, 25), 720 UNIPHIER_PINCTRL_GROUP_SINGLE(port32, port_range0, 26), 721 UNIPHIER_PINCTRL_GROUP_SINGLE(port33, port_range0, 27), 722 UNIPHIER_PINCTRL_GROUP_SINGLE(port34, port_range0, 28), 723 UNIPHIER_PINCTRL_GROUP_SINGLE(port35, port_range0, 29), 724 UNIPHIER_PINCTRL_GROUP_SINGLE(port36, port_range0, 30), 725 UNIPHIER_PINCTRL_GROUP_SINGLE(port37, port_range0, 31), 726 UNIPHIER_PINCTRL_GROUP_SINGLE(port40, port_range0, 32), 727 UNIPHIER_PINCTRL_GROUP_SINGLE(port41, port_range0, 33), 728 UNIPHIER_PINCTRL_GROUP_SINGLE(port42, port_range0, 34), 729 UNIPHIER_PINCTRL_GROUP_SINGLE(port43, port_range0, 35), 730 UNIPHIER_PINCTRL_GROUP_SINGLE(port44, port_range0, 36), 731 UNIPHIER_PINCTRL_GROUP_SINGLE(port45, port_range0, 37), 732 UNIPHIER_PINCTRL_GROUP_SINGLE(port46, port_range0, 38), 733 UNIPHIER_PINCTRL_GROUP_SINGLE(port47, port_range0, 39), 734 UNIPHIER_PINCTRL_GROUP_SINGLE(port50, port_range0, 40), 735 UNIPHIER_PINCTRL_GROUP_SINGLE(port51, port_range0, 41), 736 UNIPHIER_PINCTRL_GROUP_SINGLE(port52, port_range0, 42), 737 UNIPHIER_PINCTRL_GROUP_SINGLE(port53, port_range0, 43), 738 UNIPHIER_PINCTRL_GROUP_SINGLE(port54, port_range0, 44), 739 UNIPHIER_PINCTRL_GROUP_SINGLE(port55, port_range0, 45), 740 UNIPHIER_PINCTRL_GROUP_SINGLE(port56, port_range0, 46), 741 UNIPHIER_PINCTRL_GROUP_SINGLE(port57, port_range0, 47), 742 UNIPHIER_PINCTRL_GROUP_SINGLE(port60, port_range0, 48), 743 UNIPHIER_PINCTRL_GROUP_SINGLE(port61, port_range0, 49), 744 UNIPHIER_PINCTRL_GROUP_SINGLE(port62, port_range0, 50), 745 UNIPHIER_PINCTRL_GROUP_SINGLE(port63, port_range0, 51), 746 UNIPHIER_PINCTRL_GROUP_SINGLE(port64, port_range0, 52), 747 UNIPHIER_PINCTRL_GROUP_SINGLE(port65, port_range0, 53), 748 UNIPHIER_PINCTRL_GROUP_SINGLE(port66, port_range0, 54), 749 UNIPHIER_PINCTRL_GROUP_SINGLE(port67, port_range0, 55), 750 UNIPHIER_PINCTRL_GROUP_SINGLE(port70, port_range0, 56), 751 UNIPHIER_PINCTRL_GROUP_SINGLE(port71, port_range0, 57), 752 UNIPHIER_PINCTRL_GROUP_SINGLE(port72, port_range0, 58), 753 UNIPHIER_PINCTRL_GROUP_SINGLE(port73, port_range0, 59), 754 UNIPHIER_PINCTRL_GROUP_SINGLE(port74, port_range0, 60), 755 UNIPHIER_PINCTRL_GROUP_SINGLE(port75, port_range0, 61), 756 UNIPHIER_PINCTRL_GROUP_SINGLE(port76, port_range0, 62), 757 UNIPHIER_PINCTRL_GROUP_SINGLE(port77, port_range0, 63), 758 UNIPHIER_PINCTRL_GROUP_SINGLE(port80, port_range0, 64), 759 UNIPHIER_PINCTRL_GROUP_SINGLE(port81, port_range0, 65), 760 UNIPHIER_PINCTRL_GROUP_SINGLE(port82, port_range0, 66), 761 UNIPHIER_PINCTRL_GROUP_SINGLE(port83, port_range0, 67), 762 UNIPHIER_PINCTRL_GROUP_SINGLE(port84, port_range0, 68), 763 UNIPHIER_PINCTRL_GROUP_SINGLE(port85, port_range0, 69), 764 UNIPHIER_PINCTRL_GROUP_SINGLE(port86, port_range0, 70), 765 UNIPHIER_PINCTRL_GROUP_SINGLE(port87, port_range0, 71), 766 UNIPHIER_PINCTRL_GROUP_SINGLE(port90, port_range0, 72), 767 UNIPHIER_PINCTRL_GROUP_SINGLE(port91, port_range0, 73), 768 UNIPHIER_PINCTRL_GROUP_SINGLE(port92, port_range0, 74), 769 UNIPHIER_PINCTRL_GROUP_SINGLE(port93, port_range0, 75), 770 UNIPHIER_PINCTRL_GROUP_SINGLE(port94, port_range0, 76), 771 UNIPHIER_PINCTRL_GROUP_SINGLE(port95, port_range0, 77), 772 UNIPHIER_PINCTRL_GROUP_SINGLE(port96, port_range0, 78), 773 UNIPHIER_PINCTRL_GROUP_SINGLE(port97, port_range0, 79), 774 UNIPHIER_PINCTRL_GROUP_SINGLE(port100, port_range0, 80), 775 UNIPHIER_PINCTRL_GROUP_SINGLE(port101, port_range0, 81), 776 UNIPHIER_PINCTRL_GROUP_SINGLE(port102, port_range0, 82), 777 UNIPHIER_PINCTRL_GROUP_SINGLE(port103, port_range0, 83), 778 UNIPHIER_PINCTRL_GROUP_SINGLE(port104, port_range0, 84), 779 UNIPHIER_PINCTRL_GROUP_SINGLE(port105, port_range0, 85), 780 UNIPHIER_PINCTRL_GROUP_SINGLE(port106, port_range0, 86), 781 UNIPHIER_PINCTRL_GROUP_SINGLE(port107, port_range0, 87), 782 UNIPHIER_PINCTRL_GROUP_SINGLE(port110, port_range0, 88), 783 UNIPHIER_PINCTRL_GROUP_SINGLE(port111, port_range0, 89), 784 UNIPHIER_PINCTRL_GROUP_SINGLE(port112, port_range0, 90), 785 UNIPHIER_PINCTRL_GROUP_SINGLE(port113, port_range0, 91), 786 UNIPHIER_PINCTRL_GROUP_SINGLE(port114, port_range0, 92), 787 UNIPHIER_PINCTRL_GROUP_SINGLE(port115, port_range0, 93), 788 UNIPHIER_PINCTRL_GROUP_SINGLE(port116, port_range0, 94), 789 UNIPHIER_PINCTRL_GROUP_SINGLE(port117, port_range0, 95), 790 UNIPHIER_PINCTRL_GROUP_SINGLE(port120, port_range0, 96), 791 UNIPHIER_PINCTRL_GROUP_SINGLE(port121, port_range0, 97), 792 UNIPHIER_PINCTRL_GROUP_SINGLE(port122, port_range0, 98), 793 UNIPHIER_PINCTRL_GROUP_SINGLE(port123, port_range0, 99), 794 UNIPHIER_PINCTRL_GROUP_SINGLE(port124, port_range0, 100), 795 UNIPHIER_PINCTRL_GROUP_SINGLE(port125, port_range0, 101), 796 UNIPHIER_PINCTRL_GROUP_SINGLE(port126, port_range0, 102), 797 UNIPHIER_PINCTRL_GROUP_SINGLE(port127, port_range0, 103), 798 UNIPHIER_PINCTRL_GROUP_SINGLE(port130, port_range0, 104), 799 UNIPHIER_PINCTRL_GROUP_SINGLE(port131, port_range0, 105), 800 UNIPHIER_PINCTRL_GROUP_SINGLE(port132, port_range0, 106), 801 UNIPHIER_PINCTRL_GROUP_SINGLE(port133, port_range0, 107), 802 UNIPHIER_PINCTRL_GROUP_SINGLE(port134, port_range0, 108), 803 UNIPHIER_PINCTRL_GROUP_SINGLE(port135, port_range0, 109), 804 UNIPHIER_PINCTRL_GROUP_SINGLE(port136, port_range0, 110), 805 UNIPHIER_PINCTRL_GROUP_SINGLE(port137, port_range0, 111), 806 UNIPHIER_PINCTRL_GROUP_SINGLE(port140, port_range0, 112), 807 UNIPHIER_PINCTRL_GROUP_SINGLE(port141, port_range0, 113), 808 UNIPHIER_PINCTRL_GROUP_SINGLE(port142, port_range0, 114), 809 UNIPHIER_PINCTRL_GROUP_SINGLE(port143, port_range0, 115), 810 UNIPHIER_PINCTRL_GROUP_SINGLE(port144, port_range0, 116), 811 UNIPHIER_PINCTRL_GROUP_SINGLE(port145, port_range0, 117), 812 UNIPHIER_PINCTRL_GROUP_SINGLE(port146, port_range0, 118), 813 UNIPHIER_PINCTRL_GROUP_SINGLE(port147, port_range0, 119), 814 UNIPHIER_PINCTRL_GROUP_SINGLE(port165, port_range1, 0), 815 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0, xirq_range0, 0), 816 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1, xirq_range0, 1), 817 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2, xirq_range0, 2), 818 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3, xirq_range0, 3), 819 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4, xirq_range0, 4), 820 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5, xirq_range0, 5), 821 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6, xirq_range0, 6), 822 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7, xirq_range0, 7), 823 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8, xirq_range0, 8), 824 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9, xirq_range0, 9), 825 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10, xirq_range0, 10), 826 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11, xirq_range0, 11), 827 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq12, xirq_range0, 12), 828 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14, xirq_range1, 0), 829 UNIPHIER_PINCTRL_GROUP_SINGLE(xirq15, xirq_range1, 1), 830 }; 831 832 static const char * const emmc_groups[] = {"emmc", "emmc_dat8"}; 833 static const char * const ether_mii_groups[] = {"ether_mii"}; 834 static const char * const ether_rmii_groups[] = {"ether_rmii"}; 835 static const char * const i2c0_groups[] = {"i2c0"}; 836 static const char * const i2c1_groups[] = {"i2c1"}; 837 static const char * const i2c2_groups[] = {"i2c2"}; 838 static const char * const i2c3_groups[] = {"i2c3"}; 839 static const char * const nand_groups[] = {"nand", "nand_cs1"}; 840 static const char * const sd_groups[] = {"sd"}; 841 static const char * const system_bus_groups[] = {"system_bus", 842 "system_bus_cs0", 843 "system_bus_cs1", 844 "system_bus_cs2", 845 "system_bus_cs3"}; 846 static const char * const uart0_groups[] = {"uart0"}; 847 static const char * const uart1_groups[] = {"uart1", "uart1b"}; 848 static const char * const uart2_groups[] = {"uart2"}; 849 static const char * const uart3_groups[] = {"uart3"}; 850 static const char * const usb0_groups[] = {"usb0"}; 851 static const char * const usb1_groups[] = {"usb1"}; 852 static const char * const usb2_groups[] = {"usb2", "usb2b"}; 853 static const char * const port_groups[] = { 854 "port00", "port01", "port02", "port03", 855 "port04", "port05", "port06", "port07", 856 "port10", "port11", "port12", "port13", 857 "port14", "port15", "port16", "port17", 858 "port20", "port21", "port22", "port23", 859 "port24", "port25", "port26", "port27", 860 "port30", "port31", "port32", "port33", 861 "port34", "port35", "port36", "port37", 862 "port40", "port41", "port42", "port43", 863 "port44", "port45", "port46", "port47", 864 "port50", "port51", "port52", "port53", 865 "port54", "port55", "port56", "port57", 866 "port60", "port61", "port62", "port63", 867 "port64", "port65", "port66", "port67", 868 "port70", "port71", "port72", "port73", 869 "port74", "port75", "port76", "port77", 870 "port80", "port81", "port82", "port83", 871 "port84", "port85", "port86", "port87", 872 "port90", "port91", "port92", "port93", 873 "port94", "port95", "port96", "port97", 874 "port100", "port101", "port102", "port103", 875 "port104", "port105", "port106", "port107", 876 "port110", "port111", "port112", "port113", 877 "port114", "port115", "port116", "port117", 878 "port120", "port121", "port122", "port123", 879 "port124", "port125", "port126", "port127", 880 "port130", "port131", "port132", "port133", 881 "port134", "port135", "port136", "port137", 882 "port140", "port141", "port142", "port143", 883 "port144", "port145", "port146", "port147", 884 /* port150-164 missing */ 885 /* none */ "port165", 886 }; 887 static const char * const xirq_groups[] = { 888 "xirq0", "xirq1", "xirq2", "xirq3", 889 "xirq4", "xirq5", "xirq6", "xirq7", 890 "xirq8", "xirq9", "xirq10", "xirq11", 891 "xirq12", /* none*/ "xirq14", "xirq15", 892 }; 893 894 static const struct uniphier_pinmux_function uniphier_ld4_functions[] = { 895 UNIPHIER_PINMUX_FUNCTION(emmc), 896 UNIPHIER_PINMUX_FUNCTION(ether_mii), 897 UNIPHIER_PINMUX_FUNCTION(ether_rmii), 898 UNIPHIER_PINMUX_FUNCTION(i2c0), 899 UNIPHIER_PINMUX_FUNCTION(i2c1), 900 UNIPHIER_PINMUX_FUNCTION(i2c2), 901 UNIPHIER_PINMUX_FUNCTION(i2c3), 902 UNIPHIER_PINMUX_FUNCTION(nand), 903 UNIPHIER_PINMUX_FUNCTION(sd), 904 UNIPHIER_PINMUX_FUNCTION(system_bus), 905 UNIPHIER_PINMUX_FUNCTION(uart0), 906 UNIPHIER_PINMUX_FUNCTION(uart1), 907 UNIPHIER_PINMUX_FUNCTION(uart2), 908 UNIPHIER_PINMUX_FUNCTION(uart3), 909 UNIPHIER_PINMUX_FUNCTION(usb0), 910 UNIPHIER_PINMUX_FUNCTION(usb1), 911 UNIPHIER_PINMUX_FUNCTION(usb2), 912 UNIPHIER_PINMUX_FUNCTION(port), 913 UNIPHIER_PINMUX_FUNCTION(xirq), 914 }; 915 916 static struct uniphier_pinctrl_socdata uniphier_ld4_pindata = { 917 .pins = uniphier_ld4_pins, 918 .npins = ARRAY_SIZE(uniphier_ld4_pins), 919 .groups = uniphier_ld4_groups, 920 .groups_count = ARRAY_SIZE(uniphier_ld4_groups), 921 .functions = uniphier_ld4_functions, 922 .functions_count = ARRAY_SIZE(uniphier_ld4_functions), 923 .caps = 0, 924 }; 925 926 static int uniphier_ld4_pinctrl_probe(struct platform_device *pdev) 927 { 928 return uniphier_pinctrl_probe(pdev, &uniphier_ld4_pindata); 929 } 930 931 static const struct of_device_id uniphier_ld4_pinctrl_match[] = { 932 { .compatible = "socionext,uniphier-ld4-pinctrl" }, 933 { /* sentinel */ } 934 }; 935 936 static struct platform_driver uniphier_ld4_pinctrl_driver = { 937 .probe = uniphier_ld4_pinctrl_probe, 938 .driver = { 939 .name = "uniphier-ld4-pinctrl", 940 .of_match_table = uniphier_ld4_pinctrl_match, 941 }, 942 }; 943 builtin_platform_driver(uniphier_ld4_pinctrl_driver); 944