pinctrl-armada-37xx.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * U-Boot Marvell 37xx SoC pinctrl driver
  4. *
  5. * Copyright (C) 2017 Stefan Roese <sr@denx.de>
  6. *
  7. * This driver is based on the Linux driver version, which is:
  8. * Copyright (C) 2017 Marvell
  9. * Gregory CLEMENT <gregory.clement@free-electrons.com>
  10. *
  11. * Additionally parts are derived from the Meson U-Boot pinctrl driver,
  12. * which is:
  13. * (C) Copyright 2016 - Beniamino Galvani <b.galvani@gmail.com>
  14. * Based on code from Linux kernel:
  15. * Copyright (C) 2016 Endless Mobile, Inc.
  16. * https://spdx.org/licenses
  17. */
  18. #include <common.h>
  19. #include <config.h>
  20. #include <dm.h>
  21. #include <dm/device-internal.h>
  22. #include <dm/lists.h>
  23. #include <dm/pinctrl.h>
  24. #include <dm/root.h>
  25. #include <errno.h>
  26. #include <fdtdec.h>
  27. #include <regmap.h>
  28. #include <asm/gpio.h>
  29. #include <asm/system.h>
  30. #include <asm/io.h>
  31. DECLARE_GLOBAL_DATA_PTR;
  32. #define OUTPUT_EN 0x0
  33. #define INPUT_VAL 0x10
  34. #define OUTPUT_VAL 0x18
  35. #define OUTPUT_CTL 0x20
  36. #define SELECTION 0x30
  37. #define IRQ_EN 0x0
  38. #define IRQ_POL 0x08
  39. #define IRQ_STATUS 0x10
  40. #define IRQ_WKUP 0x18
  41. #define NB_FUNCS 3
  42. #define GPIO_PER_REG 32
  43. /**
  44. * struct armada_37xx_pin_group: represents group of pins of a pinmux function.
  45. * The pins of a pinmux groups are composed of one or two groups of contiguous
  46. * pins.
  47. * @name: Name of the pin group, used to lookup the group.
  48. * @start_pins: Index of the first pin of the main range of pins belonging to
  49. * the group
  50. * @npins: Number of pins included in the first range
  51. * @reg_mask: Bit mask matching the group in the selection register
  52. * @extra_pins: Index of the first pin of the optional second range of pins
  53. * belonging to the group
  54. * @npins: Number of pins included in the second optional range
  55. * @funcs: A list of pinmux functions that can be selected for this group.
  56. * @pins: List of the pins included in the group
  57. */
  58. struct armada_37xx_pin_group {
  59. const char *name;
  60. unsigned int start_pin;
  61. unsigned int npins;
  62. u32 reg_mask;
  63. u32 val[NB_FUNCS];
  64. unsigned int extra_pin;
  65. unsigned int extra_npins;
  66. const char *funcs[NB_FUNCS];
  67. unsigned int *pins;
  68. };
  69. struct armada_37xx_pin_data {
  70. u8 nr_pins;
  71. char *name;
  72. struct armada_37xx_pin_group *groups;
  73. int ngroups;
  74. };
  75. struct armada_37xx_pmx_func {
  76. const char *name;
  77. const char **groups;
  78. unsigned int ngroups;
  79. };
  80. struct armada_37xx_pinctrl {
  81. void __iomem *base;
  82. const struct armada_37xx_pin_data *data;
  83. struct udevice *dev;
  84. struct pinctrl_dev *pctl_dev;
  85. struct armada_37xx_pin_group *groups;
  86. unsigned int ngroups;
  87. struct armada_37xx_pmx_func *funcs;
  88. unsigned int nfuncs;
  89. };
  90. #define PIN_GRP(_name, _start, _nr, _mask, _func1, _func2) \
  91. { \
  92. .name = _name, \
  93. .start_pin = _start, \
  94. .npins = _nr, \
  95. .reg_mask = _mask, \
  96. .val = {0, _mask}, \
  97. .funcs = {_func1, _func2} \
  98. }
  99. #define PIN_GRP_GPIO(_name, _start, _nr, _mask, _func1) \
  100. { \
  101. .name = _name, \
  102. .start_pin = _start, \
  103. .npins = _nr, \
  104. .reg_mask = _mask, \
  105. .val = {0, _mask}, \
  106. .funcs = {_func1, "gpio"} \
  107. }
  108. #define PIN_GRP_GPIO_2(_name, _start, _nr, _mask, _val1, _val2, _func1) \
  109. { \
  110. .name = _name, \
  111. .start_pin = _start, \
  112. .npins = _nr, \
  113. .reg_mask = _mask, \
  114. .val = {_val1, _val2}, \
  115. .funcs = {_func1, "gpio"} \
  116. }
  117. #define PIN_GRP_GPIO_3(_name, _start, _nr, _mask, _v1, _v2, _v3, _f1, _f2) \
  118. { \
  119. .name = _name, \
  120. .start_pin = _start, \
  121. .npins = _nr, \
  122. .reg_mask = _mask, \
  123. .val = {_v1, _v2, _v3}, \
  124. .funcs = {_f1, _f2, "gpio"} \
  125. }
  126. #define PIN_GRP_EXTRA(_name, _start, _nr, _mask, _v1, _v2, _start2, _nr2, \
  127. _f1, _f2) \
  128. { \
  129. .name = _name, \
  130. .start_pin = _start, \
  131. .npins = _nr, \
  132. .reg_mask = _mask, \
  133. .val = {_v1, _v2}, \
  134. .extra_pin = _start2, \
  135. .extra_npins = _nr2, \
  136. .funcs = {_f1, _f2} \
  137. }
  138. static struct armada_37xx_pin_group armada_37xx_nb_groups[] = {
  139. PIN_GRP_GPIO("jtag", 20, 5, BIT(0), "jtag"),
  140. PIN_GRP_GPIO("sdio0", 8, 3, BIT(1), "sdio"),
  141. PIN_GRP_GPIO("emmc_nb", 27, 9, BIT(2), "emmc"),
  142. PIN_GRP_GPIO("pwm0", 11, 1, BIT(3), "pwm"),
  143. PIN_GRP_GPIO("pwm1", 12, 1, BIT(4), "pwm"),
  144. PIN_GRP_GPIO("pwm2", 13, 1, BIT(5), "pwm"),
  145. PIN_GRP_GPIO("pwm3", 14, 1, BIT(6), "pwm"),
  146. PIN_GRP_GPIO("pmic1", 7, 1, BIT(7), "pmic"),
  147. PIN_GRP_GPIO("pmic0", 6, 1, BIT(8), "pmic"),
  148. PIN_GRP_GPIO("i2c2", 2, 2, BIT(9), "i2c"),
  149. PIN_GRP_GPIO("i2c1", 0, 2, BIT(10), "i2c"),
  150. PIN_GRP_GPIO("spi_cs1", 17, 1, BIT(12), "spi"),
  151. PIN_GRP_GPIO_2("spi_cs2", 18, 1, BIT(13) | BIT(19), 0, BIT(13), "spi"),
  152. PIN_GRP_GPIO_2("spi_cs3", 19, 1, BIT(14) | BIT(19), 0, BIT(14), "spi"),
  153. PIN_GRP_GPIO("onewire", 4, 1, BIT(16), "onewire"),
  154. PIN_GRP_GPIO("uart1", 25, 2, BIT(17), "uart"),
  155. PIN_GRP_GPIO("spi_quad", 15, 2, BIT(18), "spi"),
  156. PIN_GRP_EXTRA("uart2", 9, 2, BIT(1) | BIT(13) | BIT(14) | BIT(19),
  157. BIT(1) | BIT(13) | BIT(14), BIT(1) | BIT(19),
  158. 18, 2, "gpio", "uart"),
  159. PIN_GRP_GPIO("led0_od", 11, 1, BIT(20), "led"),
  160. PIN_GRP_GPIO("led1_od", 12, 1, BIT(21), "led"),
  161. PIN_GRP_GPIO("led2_od", 13, 1, BIT(22), "led"),
  162. PIN_GRP_GPIO("led3_od", 14, 1, BIT(23), "led"),
  163. };
  164. static struct armada_37xx_pin_group armada_37xx_sb_groups[] = {
  165. PIN_GRP_GPIO("usb32_drvvbus0", 0, 1, BIT(0), "drvbus"),
  166. PIN_GRP_GPIO("usb2_drvvbus1", 1, 1, BIT(1), "drvbus"),
  167. PIN_GRP_GPIO("sdio_sb", 24, 6, BIT(2), "sdio"),
  168. PIN_GRP_GPIO("rgmii", 6, 12, BIT(3), "mii"),
  169. PIN_GRP_GPIO("smi", 18, 2, BIT(4), "smi"),
  170. PIN_GRP_GPIO("pcie1", 3, 3, BIT(5) | BIT(9) | BIT(10), "pcie"),
  171. PIN_GRP_GPIO("ptp", 20, 3, BIT(11) | BIT(12) | BIT(13), "ptp"),
  172. PIN_GRP("ptp_clk", 21, 1, BIT(6), "ptp", "mii"),
  173. PIN_GRP("ptp_trig", 22, 1, BIT(7), "ptp", "mii"),
  174. PIN_GRP_GPIO_3("mii_col", 23, 1, BIT(8) | BIT(14), 0, BIT(8), BIT(14),
  175. "mii", "mii_err"),
  176. };
  177. const struct armada_37xx_pin_data armada_37xx_pin_nb = {
  178. .nr_pins = 36,
  179. .name = "GPIO1",
  180. .groups = armada_37xx_nb_groups,
  181. .ngroups = ARRAY_SIZE(armada_37xx_nb_groups),
  182. };
  183. const struct armada_37xx_pin_data armada_37xx_pin_sb = {
  184. .nr_pins = 30,
  185. .name = "GPIO2",
  186. .groups = armada_37xx_sb_groups,
  187. .ngroups = ARRAY_SIZE(armada_37xx_sb_groups),
  188. };
  189. static inline void armada_37xx_update_reg(unsigned int *reg,
  190. unsigned int *offset)
  191. {
  192. /* We never have more than 2 registers */
  193. if (*offset >= GPIO_PER_REG) {
  194. *offset -= GPIO_PER_REG;
  195. *reg += sizeof(u32);
  196. }
  197. }
  198. static int armada_37xx_get_func_reg(struct armada_37xx_pin_group *grp,
  199. const char *func)
  200. {
  201. int f;
  202. for (f = 0; (f < NB_FUNCS) && grp->funcs[f]; f++)
  203. if (!strcmp(grp->funcs[f], func))
  204. return f;
  205. return -ENOTSUPP;
  206. }
  207. static int armada_37xx_pmx_get_groups_count(struct udevice *dev)
  208. {
  209. struct armada_37xx_pinctrl *info = dev_get_priv(dev);
  210. return info->ngroups;
  211. }
  212. static const char *armada_37xx_pmx_dummy_name = "_dummy";
  213. static const char *armada_37xx_pmx_get_group_name(struct udevice *dev,
  214. unsigned selector)
  215. {
  216. struct armada_37xx_pinctrl *info = dev_get_priv(dev);
  217. if (!info->groups[selector].name)
  218. return armada_37xx_pmx_dummy_name;
  219. return info->groups[selector].name;
  220. }
  221. static int armada_37xx_pmx_get_funcs_count(struct udevice *dev)
  222. {
  223. struct armada_37xx_pinctrl *info = dev_get_priv(dev);
  224. return info->nfuncs;
  225. }
  226. static const char *armada_37xx_pmx_get_func_name(struct udevice *dev,
  227. unsigned selector)
  228. {
  229. struct armada_37xx_pinctrl *info = dev_get_priv(dev);
  230. return info->funcs[selector].name;
  231. }
  232. static int armada_37xx_pmx_set_by_name(struct udevice *dev,
  233. const char *name,
  234. struct armada_37xx_pin_group *grp)
  235. {
  236. struct armada_37xx_pinctrl *info = dev_get_priv(dev);
  237. unsigned int reg = SELECTION;
  238. unsigned int mask = grp->reg_mask;
  239. int func, val;
  240. dev_dbg(info->dev, "enable function %s group %s\n",
  241. name, grp->name);
  242. func = armada_37xx_get_func_reg(grp, name);
  243. if (func < 0)
  244. return func;
  245. val = grp->val[func];
  246. clrsetbits_le32(info->base + reg, mask, val);
  247. return 0;
  248. }
  249. static int armada_37xx_pmx_group_set(struct udevice *dev,
  250. unsigned group_selector,
  251. unsigned func_selector)
  252. {
  253. struct armada_37xx_pinctrl *info = dev_get_priv(dev);
  254. struct armada_37xx_pin_group *grp = &info->groups[group_selector];
  255. const char *name = info->funcs[func_selector].name;
  256. return armada_37xx_pmx_set_by_name(dev, name, grp);
  257. }
  258. /**
  259. * armada_37xx_add_function() - Add a new function to the list
  260. * @funcs: array of function to add the new one
  261. * @funcsize: size of the remaining space for the function
  262. * @name: name of the function to add
  263. *
  264. * If it is a new function then create it by adding its name else
  265. * increment the number of group associated to this function.
  266. */
  267. static int armada_37xx_add_function(struct armada_37xx_pmx_func *funcs,
  268. int *funcsize, const char *name)
  269. {
  270. int i = 0;
  271. if (*funcsize <= 0)
  272. return -EOVERFLOW;
  273. while (funcs->ngroups) {
  274. /* function already there */
  275. if (strcmp(funcs->name, name) == 0) {
  276. funcs->ngroups++;
  277. return -EEXIST;
  278. }
  279. funcs++;
  280. i++;
  281. }
  282. /* append new unique function */
  283. funcs->name = name;
  284. funcs->ngroups = 1;
  285. (*funcsize)--;
  286. return 0;
  287. }
  288. /**
  289. * armada_37xx_fill_group() - complete the group array
  290. * @info: info driver instance
  291. *
  292. * Based on the data available from the armada_37xx_pin_group array
  293. * completes the last member of the struct for each function: the list
  294. * of the groups associated to this function.
  295. *
  296. */
  297. static int armada_37xx_fill_group(struct armada_37xx_pinctrl *info)
  298. {
  299. int n, num = 0, funcsize = info->data->nr_pins;
  300. for (n = 0; n < info->ngroups; n++) {
  301. struct armada_37xx_pin_group *grp = &info->groups[n];
  302. int i, j, f;
  303. grp->pins = devm_kzalloc(info->dev,
  304. (grp->npins + grp->extra_npins) *
  305. sizeof(*grp->pins), GFP_KERNEL);
  306. if (!grp->pins)
  307. return -ENOMEM;
  308. for (i = 0; i < grp->npins; i++)
  309. grp->pins[i] = grp->start_pin + i;
  310. for (j = 0; j < grp->extra_npins; j++)
  311. grp->pins[i+j] = grp->extra_pin + j;
  312. for (f = 0; (f < NB_FUNCS) && grp->funcs[f]; f++) {
  313. int ret;
  314. /* check for unique functions and count groups */
  315. ret = armada_37xx_add_function(info->funcs, &funcsize,
  316. grp->funcs[f]);
  317. if (ret == -EOVERFLOW)
  318. dev_err(info->dev,
  319. "More functions than pins(%d)\n",
  320. info->data->nr_pins);
  321. if (ret < 0)
  322. continue;
  323. num++;
  324. }
  325. }
  326. info->nfuncs = num;
  327. return 0;
  328. }
  329. /**
  330. * armada_37xx_fill_funcs() - complete the funcs array
  331. * @info: info driver instance
  332. *
  333. * Based on the data available from the armada_37xx_pin_group array
  334. * completes the last two member of the struct for each group:
  335. * - the list of the pins included in the group
  336. * - the list of pinmux functions that can be selected for this group
  337. *
  338. */
  339. static int armada_37xx_fill_func(struct armada_37xx_pinctrl *info)
  340. {
  341. struct armada_37xx_pmx_func *funcs = info->funcs;
  342. int n;
  343. for (n = 0; n < info->nfuncs; n++) {
  344. const char *name = funcs[n].name;
  345. const char **groups;
  346. int g;
  347. funcs[n].groups = devm_kzalloc(info->dev, funcs[n].ngroups *
  348. sizeof(*(funcs[n].groups)),
  349. GFP_KERNEL);
  350. if (!funcs[n].groups)
  351. return -ENOMEM;
  352. groups = funcs[n].groups;
  353. for (g = 0; g < info->ngroups; g++) {
  354. struct armada_37xx_pin_group *gp = &info->groups[g];
  355. int f;
  356. for (f = 0; (f < NB_FUNCS) && gp->funcs[f]; f++) {
  357. if (strcmp(gp->funcs[f], name) == 0) {
  358. *groups = gp->name;
  359. groups++;
  360. }
  361. }
  362. }
  363. }
  364. return 0;
  365. }
  366. static int armada_37xx_gpio_get(struct udevice *dev, unsigned int offset)
  367. {
  368. struct armada_37xx_pinctrl *info = dev_get_priv(dev->parent);
  369. unsigned int reg = INPUT_VAL;
  370. unsigned int val, mask;
  371. armada_37xx_update_reg(&reg, &offset);
  372. mask = BIT(offset);
  373. val = readl(info->base + reg);
  374. return (val & mask) != 0;
  375. }
  376. static int armada_37xx_gpio_set(struct udevice *dev, unsigned int offset,
  377. int value)
  378. {
  379. struct armada_37xx_pinctrl *info = dev_get_priv(dev->parent);
  380. unsigned int reg = OUTPUT_VAL;
  381. unsigned int mask, val;
  382. armada_37xx_update_reg(&reg, &offset);
  383. mask = BIT(offset);
  384. val = value ? mask : 0;
  385. clrsetbits_le32(info->base + reg, mask, val);
  386. return 0;
  387. }
  388. static int armada_37xx_gpio_get_direction(struct udevice *dev,
  389. unsigned int offset)
  390. {
  391. struct armada_37xx_pinctrl *info = dev_get_priv(dev->parent);
  392. unsigned int reg = OUTPUT_EN;
  393. unsigned int val, mask;
  394. armada_37xx_update_reg(&reg, &offset);
  395. mask = BIT(offset);
  396. val = readl(info->base + reg);
  397. if (val & mask)
  398. return GPIOF_OUTPUT;
  399. else
  400. return GPIOF_INPUT;
  401. }
  402. static int armada_37xx_gpio_direction_input(struct udevice *dev,
  403. unsigned int offset)
  404. {
  405. struct armada_37xx_pinctrl *info = dev_get_priv(dev->parent);
  406. unsigned int reg = OUTPUT_EN;
  407. unsigned int mask;
  408. armada_37xx_update_reg(&reg, &offset);
  409. mask = BIT(offset);
  410. clrbits_le32(info->base + reg, mask);
  411. return 0;
  412. }
  413. static int armada_37xx_gpio_direction_output(struct udevice *dev,
  414. unsigned int offset, int value)
  415. {
  416. struct armada_37xx_pinctrl *info = dev_get_priv(dev->parent);
  417. unsigned int reg = OUTPUT_EN;
  418. unsigned int mask;
  419. armada_37xx_update_reg(&reg, &offset);
  420. mask = BIT(offset);
  421. setbits_le32(info->base + reg, mask);
  422. /* And set the requested value */
  423. return armada_37xx_gpio_set(dev, offset, value);
  424. }
  425. static int armada_37xx_gpio_probe(struct udevice *dev)
  426. {
  427. struct armada_37xx_pinctrl *info = dev_get_priv(dev->parent);
  428. struct gpio_dev_priv *uc_priv;
  429. uc_priv = dev_get_uclass_priv(dev);
  430. uc_priv->bank_name = info->data->name;
  431. uc_priv->gpio_count = info->data->nr_pins;
  432. return 0;
  433. }
  434. static const struct dm_gpio_ops armada_37xx_gpio_ops = {
  435. .set_value = armada_37xx_gpio_set,
  436. .get_value = armada_37xx_gpio_get,
  437. .get_function = armada_37xx_gpio_get_direction,
  438. .direction_input = armada_37xx_gpio_direction_input,
  439. .direction_output = armada_37xx_gpio_direction_output,
  440. };
  441. static struct driver armada_37xx_gpio_driver = {
  442. .name = "armada-37xx-gpio",
  443. .id = UCLASS_GPIO,
  444. .probe = armada_37xx_gpio_probe,
  445. .ops = &armada_37xx_gpio_ops,
  446. };
  447. static int armada_37xx_gpiochip_register(struct udevice *parent,
  448. struct armada_37xx_pinctrl *info)
  449. {
  450. const void *blob = gd->fdt_blob;
  451. int node = dev_of_offset(parent);
  452. struct uclass_driver *drv;
  453. struct udevice *dev;
  454. int ret = -ENODEV;
  455. int subnode;
  456. char *name;
  457. /* Lookup GPIO driver */
  458. drv = lists_uclass_lookup(UCLASS_GPIO);
  459. if (!drv) {
  460. puts("Cannot find GPIO driver\n");
  461. return -ENOENT;
  462. }
  463. fdt_for_each_subnode(subnode, blob, node) {
  464. if (fdtdec_get_bool(blob, subnode, "gpio-controller")) {
  465. ret = 0;
  466. break;
  467. }
  468. };
  469. if (ret)
  470. return ret;
  471. name = calloc(1, 32);
  472. sprintf(name, "armada-37xx-gpio");
  473. /* Create child device UCLASS_GPIO and bind it */
  474. device_bind(parent, &armada_37xx_gpio_driver, name, NULL, subnode,
  475. &dev);
  476. dev_set_of_offset(dev, subnode);
  477. return 0;
  478. }
  479. const struct pinctrl_ops armada_37xx_pinctrl_ops = {
  480. .get_groups_count = armada_37xx_pmx_get_groups_count,
  481. .get_group_name = armada_37xx_pmx_get_group_name,
  482. .get_functions_count = armada_37xx_pmx_get_funcs_count,
  483. .get_function_name = armada_37xx_pmx_get_func_name,
  484. .pinmux_group_set = armada_37xx_pmx_group_set,
  485. .set_state = pinctrl_generic_set_state,
  486. };
  487. int armada_37xx_pinctrl_probe(struct udevice *dev)
  488. {
  489. struct armada_37xx_pinctrl *info = dev_get_priv(dev);
  490. const struct armada_37xx_pin_data *pin_data;
  491. int ret;
  492. info->data = (struct armada_37xx_pin_data *)dev_get_driver_data(dev);
  493. pin_data = info->data;
  494. info->base = (void __iomem *)devfdt_get_addr(dev);
  495. if (!info->base) {
  496. pr_err("unable to find regmap\n");
  497. return -ENODEV;
  498. }
  499. info->groups = pin_data->groups;
  500. info->ngroups = pin_data->ngroups;
  501. /*
  502. * we allocate functions for number of pins and hope there are
  503. * fewer unique functions than pins available
  504. */
  505. info->funcs = devm_kzalloc(info->dev, pin_data->nr_pins *
  506. sizeof(struct armada_37xx_pmx_func), GFP_KERNEL);
  507. if (!info->funcs)
  508. return -ENOMEM;
  509. ret = armada_37xx_fill_group(info);
  510. if (ret)
  511. return ret;
  512. ret = armada_37xx_fill_func(info);
  513. if (ret)
  514. return ret;
  515. ret = armada_37xx_gpiochip_register(dev, info);
  516. if (ret)
  517. return ret;
  518. return 0;
  519. }
  520. static const struct udevice_id armada_37xx_pinctrl_of_match[] = {
  521. {
  522. .compatible = "marvell,armada3710-sb-pinctrl",
  523. .data = (ulong)&armada_37xx_pin_sb,
  524. },
  525. {
  526. .compatible = "marvell,armada3710-nb-pinctrl",
  527. .data = (ulong)&armada_37xx_pin_nb,
  528. },
  529. { /* sentinel */ }
  530. };
  531. U_BOOT_DRIVER(armada_37xx_pinctrl) = {
  532. .name = "armada-37xx-pinctrl",
  533. .id = UCLASS_PINCTRL,
  534. .of_match = of_match_ptr(armada_37xx_pinctrl_of_match),
  535. .probe = armada_37xx_pinctrl_probe,
  536. .priv_auto_alloc_size = sizeof(struct armada_37xx_pinctrl),
  537. .ops = &armada_37xx_pinctrl_ops,
  538. };