18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Marvell Armada 39x pinctrl driver based on mvebu pinctrl core 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2015 Marvell 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#include <linux/err.h> 118c2ecf20Sopenharmony_ci#include <linux/init.h> 128c2ecf20Sopenharmony_ci#include <linux/io.h> 138c2ecf20Sopenharmony_ci#include <linux/platform_device.h> 148c2ecf20Sopenharmony_ci#include <linux/of.h> 158c2ecf20Sopenharmony_ci#include <linux/of_device.h> 168c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinctrl.h> 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#include "pinctrl-mvebu.h" 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_cienum { 218c2ecf20Sopenharmony_ci V_88F6920 = BIT(0), 228c2ecf20Sopenharmony_ci V_88F6925 = BIT(1), 238c2ecf20Sopenharmony_ci V_88F6928 = BIT(2), 248c2ecf20Sopenharmony_ci V_88F6920_PLUS = (V_88F6920 | V_88F6925 | V_88F6928), 258c2ecf20Sopenharmony_ci V_88F6925_PLUS = (V_88F6925 | V_88F6928), 268c2ecf20Sopenharmony_ci}; 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_cistatic struct mvebu_mpp_mode armada_39x_mpp_modes[] = { 298c2ecf20Sopenharmony_ci MPP_MODE(0, 308c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 318c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua0", "rxd", V_88F6920_PLUS)), 328c2ecf20Sopenharmony_ci MPP_MODE(1, 338c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 348c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua0", "txd", V_88F6920_PLUS)), 358c2ecf20Sopenharmony_ci MPP_MODE(2, 368c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 378c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "i2c0", "sck", V_88F6920_PLUS)), 388c2ecf20Sopenharmony_ci MPP_MODE(3, 398c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 408c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "i2c0", "sda", V_88F6920_PLUS)), 418c2ecf20Sopenharmony_ci MPP_MODE(4, 428c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 438c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "ua1", "txd", V_88F6920_PLUS), 448c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "rts", V_88F6920_PLUS), 458c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "smi", "mdc", V_88F6920_PLUS)), 468c2ecf20Sopenharmony_ci MPP_MODE(5, 478c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 488c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "ua1", "rxd", V_88F6920_PLUS), 498c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "cts", V_88F6920_PLUS), 508c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "smi", "mdio", V_88F6920_PLUS)), 518c2ecf20Sopenharmony_ci MPP_MODE(6, 528c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 538c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "cs3", V_88F6920_PLUS), 548c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "xsmi", "mdio", V_88F6920_PLUS)), 558c2ecf20Sopenharmony_ci MPP_MODE(7, 568c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 578c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad9", V_88F6920_PLUS), 588c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "xsmi", "mdc", V_88F6920_PLUS)), 598c2ecf20Sopenharmony_ci MPP_MODE(8, 608c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 618c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad10", V_88F6920_PLUS), 628c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "ptp", "trig", V_88F6920_PLUS)), 638c2ecf20Sopenharmony_ci MPP_MODE(9, 648c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 658c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad11", V_88F6920_PLUS), 668c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "ptp", "clk", V_88F6920_PLUS)), 678c2ecf20Sopenharmony_ci MPP_MODE(10, 688c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 698c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad12", V_88F6920_PLUS), 708c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "ptp", "evreq", V_88F6920_PLUS)), 718c2ecf20Sopenharmony_ci MPP_MODE(11, 728c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 738c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad13", V_88F6920_PLUS), 748c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "led", "clk", V_88F6920_PLUS)), 758c2ecf20Sopenharmony_ci MPP_MODE(12, 768c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 778c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "pcie0", "rstout", V_88F6920_PLUS), 788c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad14", V_88F6920_PLUS), 798c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "led", "stb", V_88F6920_PLUS)), 808c2ecf20Sopenharmony_ci MPP_MODE(13, 818c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 828c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad15", V_88F6920_PLUS), 838c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "pcie2", "clkreq", V_88F6920_PLUS), 848c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "led", "data", V_88F6920_PLUS)), 858c2ecf20Sopenharmony_ci MPP_MODE(14, 868c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 878c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "dram", "vttctrl", V_88F6920_PLUS), 888c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "we1", V_88F6920_PLUS), 898c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "ua1", "txd", V_88F6920_PLUS)), 908c2ecf20Sopenharmony_ci MPP_MODE(15, 918c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 928c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "pcie0", "rstout", V_88F6920_PLUS), 938c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi0", "mosi", V_88F6920_PLUS), 948c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "i2c1", "sck", V_88F6920_PLUS)), 958c2ecf20Sopenharmony_ci MPP_MODE(16, 968c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 978c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "dram", "deccerr", V_88F6920_PLUS), 988c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi0", "miso", V_88F6920_PLUS), 998c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "pcie0", "clkreq", V_88F6920_PLUS), 1008c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "i2c1", "sda", V_88F6920_PLUS)), 1018c2ecf20Sopenharmony_ci MPP_MODE(17, 1028c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1038c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua1", "rxd", V_88F6920_PLUS), 1048c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi0", "sck", V_88F6920_PLUS), 1058c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sata1", "prsnt", V_88F6925_PLUS), 1068c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "sata0", "prsnt", V_88F6925_PLUS), 1078c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "smi", "mdio", V_88F6920_PLUS)), 1088c2ecf20Sopenharmony_ci MPP_MODE(18, 1098c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1108c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua1", "txd", V_88F6920_PLUS), 1118c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi0", "cs0", V_88F6920_PLUS), 1128c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "i2c2", "sck", V_88F6920_PLUS)), 1138c2ecf20Sopenharmony_ci MPP_MODE(19, 1148c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1158c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sata1", "prsnt", V_88F6925_PLUS), 1168c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "ua0", "cts", V_88F6920_PLUS), 1178c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6920_PLUS), 1188c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "i2c2", "sda", V_88F6920_PLUS)), 1198c2ecf20Sopenharmony_ci MPP_MODE(20, 1208c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1218c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sata0", "prsnt", V_88F6925_PLUS), 1228c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "ua0", "rts", V_88F6920_PLUS), 1238c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6920_PLUS), 1248c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "smi", "mdc", V_88F6920_PLUS)), 1258c2ecf20Sopenharmony_ci MPP_MODE(21, 1268c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1278c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "cs1", V_88F6920_PLUS), 1288c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "sata0", "prsnt", V_88F6925_PLUS), 1298c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "cmd", V_88F6920_PLUS), 1308c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "bootcs", V_88F6920_PLUS), 1318c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "sata1", "prsnt", V_88F6925_PLUS), 1328c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "rxd0", V_88F6920_PLUS)), 1338c2ecf20Sopenharmony_ci MPP_MODE(22, 1348c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1358c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "mosi", V_88F6920_PLUS), 1368c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad0", V_88F6920_PLUS)), 1378c2ecf20Sopenharmony_ci MPP_MODE(23, 1388c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1398c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "sck", V_88F6920_PLUS), 1408c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad2", V_88F6920_PLUS)), 1418c2ecf20Sopenharmony_ci MPP_MODE(24, 1428c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1438c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "miso", V_88F6920_PLUS), 1448c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "ua0", "cts", V_88F6920_PLUS), 1458c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua1", "rxd", V_88F6920_PLUS), 1468c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d4", V_88F6920_PLUS), 1478c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ready", V_88F6920_PLUS)), 1488c2ecf20Sopenharmony_ci MPP_MODE(25, 1498c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1508c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "cs0", V_88F6920_PLUS), 1518c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "ua0", "rts", V_88F6920_PLUS), 1528c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua1", "txd", V_88F6920_PLUS), 1538c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d5", V_88F6920_PLUS), 1548c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "cs0", V_88F6920_PLUS)), 1558c2ecf20Sopenharmony_ci MPP_MODE(26, 1568c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1578c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "cs2", V_88F6920_PLUS), 1588c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "i2c1", "sck", V_88F6920_PLUS), 1598c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d6", V_88F6920_PLUS), 1608c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "cs1", V_88F6920_PLUS)), 1618c2ecf20Sopenharmony_ci MPP_MODE(27, 1628c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1638c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "cs3", V_88F6920_PLUS), 1648c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "i2c1", "sda", V_88F6920_PLUS), 1658c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d7", V_88F6920_PLUS), 1668c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "cs2", V_88F6920_PLUS), 1678c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "txclkout", V_88F6920_PLUS)), 1688c2ecf20Sopenharmony_ci MPP_MODE(28, 1698c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1708c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "clk", V_88F6920_PLUS), 1718c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad5", V_88F6920_PLUS), 1728c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "txd0", V_88F6920_PLUS)), 1738c2ecf20Sopenharmony_ci MPP_MODE(29, 1748c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1758c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ale0", V_88F6920_PLUS), 1768c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "txd1", V_88F6920_PLUS)), 1778c2ecf20Sopenharmony_ci MPP_MODE(30, 1788c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1798c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "oe", V_88F6920_PLUS), 1808c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "txd2", V_88F6920_PLUS)), 1818c2ecf20Sopenharmony_ci MPP_MODE(31, 1828c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1838c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ale1", V_88F6920_PLUS), 1848c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "txd3", V_88F6920_PLUS)), 1858c2ecf20Sopenharmony_ci MPP_MODE(32, 1868c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1878c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "we0", V_88F6920_PLUS), 1888c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "txctl", V_88F6920_PLUS)), 1898c2ecf20Sopenharmony_ci MPP_MODE(33, 1908c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1918c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "dram", "deccerr", V_88F6920_PLUS), 1928c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad3", V_88F6920_PLUS)), 1938c2ecf20Sopenharmony_ci MPP_MODE(34, 1948c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1958c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad1", V_88F6920_PLUS)), 1968c2ecf20Sopenharmony_ci MPP_MODE(35, 1978c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 1988c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "ref", "clk_out1", V_88F6920_PLUS), 1998c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "a1", V_88F6920_PLUS)), 2008c2ecf20Sopenharmony_ci MPP_MODE(36, 2018c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2028c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "a0", V_88F6920_PLUS)), 2038c2ecf20Sopenharmony_ci MPP_MODE(37, 2048c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2058c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d3", V_88F6920_PLUS), 2068c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad8", V_88F6920_PLUS), 2078c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "rxclk", V_88F6920_PLUS)), 2088c2ecf20Sopenharmony_ci MPP_MODE(38, 2098c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2108c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "ref", "clk_out0", V_88F6920_PLUS), 2118c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d0", V_88F6920_PLUS), 2128c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad4", V_88F6920_PLUS), 2138c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "rxd1", V_88F6920_PLUS)), 2148c2ecf20Sopenharmony_ci MPP_MODE(39, 2158c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2168c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "i2c1", "sck", V_88F6920_PLUS), 2178c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "cts", V_88F6920_PLUS), 2188c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d1", V_88F6920_PLUS), 2198c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "a2", V_88F6920_PLUS), 2208c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "rxd2", V_88F6920_PLUS)), 2218c2ecf20Sopenharmony_ci MPP_MODE(40, 2228c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2238c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "i2c1", "sda", V_88F6920_PLUS), 2248c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "rts", V_88F6920_PLUS), 2258c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d2", V_88F6920_PLUS), 2268c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad6", V_88F6920_PLUS), 2278c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "rxd3", V_88F6920_PLUS)), 2288c2ecf20Sopenharmony_ci MPP_MODE(41, 2298c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2308c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua1", "rxd", V_88F6920_PLUS), 2318c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "cts", V_88F6920_PLUS), 2328c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "cs3", V_88F6920_PLUS), 2338c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "burst/last", V_88F6920_PLUS), 2348c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "nand", "rb0", V_88F6920_PLUS), 2358c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(8, "ge", "rxctl", V_88F6920_PLUS)), 2368c2ecf20Sopenharmony_ci MPP_MODE(42, 2378c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2388c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua1", "txd", V_88F6920_PLUS), 2398c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "rts", V_88F6920_PLUS), 2408c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad7", V_88F6920_PLUS)), 2418c2ecf20Sopenharmony_ci MPP_MODE(43, 2428c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2438c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "pcie0", "clkreq", V_88F6920_PLUS), 2448c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "dram", "vttctrl", V_88F6920_PLUS), 2458c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "dram", "deccerr", V_88F6920_PLUS), 2468c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "cs2", V_88F6920_PLUS), 2478c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "clkout", V_88F6920_PLUS), 2488c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "nand", "rb1", V_88F6920_PLUS)), 2498c2ecf20Sopenharmony_ci MPP_MODE(44, 2508c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2518c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6925_PLUS), 2528c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "sata1", "prsnt", V_88F6925_PLUS), 2538c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "sata2", "prsnt", V_88F6928), 2548c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "sata3", "prsnt", V_88F6928), 2558c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "led", "clk", V_88F6920_PLUS)), 2568c2ecf20Sopenharmony_ci MPP_MODE(45, 2578c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2588c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "ref", "clk_out0", V_88F6920_PLUS), 2598c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "pcie0", "rstout", V_88F6920_PLUS), 2608c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6920_PLUS)), 2618c2ecf20Sopenharmony_ci MPP_MODE(46, 2628c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2638c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "ref", "clk_out1", V_88F6920_PLUS), 2648c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "pcie0", "rstout", V_88F6920_PLUS), 2658c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6920_PLUS), 2668c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "led", "stb", V_88F6920_PLUS)), 2678c2ecf20Sopenharmony_ci MPP_MODE(47, 2688c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2698c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6925_PLUS), 2708c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "sata1", "prsnt", V_88F6925_PLUS), 2718c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "sata2", "prsnt", V_88F6928), 2728c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sata3", "prsnt", V_88F6928), 2738c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "led", "data", V_88F6920_PLUS)), 2748c2ecf20Sopenharmony_ci MPP_MODE(48, 2758c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2768c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6925_PLUS), 2778c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "dram", "vttctrl", V_88F6920_PLUS), 2788c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "pclk", V_88F6928), 2798c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "mclk", V_88F6928), 2808c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d4", V_88F6920_PLUS), 2818c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "pcie0", "clkreq", V_88F6920_PLUS), 2828c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "ua1", "txd", V_88F6920_PLUS)), 2838c2ecf20Sopenharmony_ci MPP_MODE(49, 2848c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2858c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata2", "prsnt", V_88F6928), 2868c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "sata3", "prsnt", V_88F6928), 2878c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "fsync", V_88F6928), 2888c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "lrclk", V_88F6928), 2898c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d5", V_88F6920_PLUS), 2908c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "ua2", "rxd", V_88F6920_PLUS)), 2918c2ecf20Sopenharmony_ci MPP_MODE(50, 2928c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 2938c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "pcie0", "rstout", V_88F6920_PLUS), 2948c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "drx", V_88F6928), 2958c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "extclk", V_88F6928), 2968c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "cmd", V_88F6920_PLUS), 2978c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "ua2", "rxd", V_88F6920_PLUS)), 2988c2ecf20Sopenharmony_ci MPP_MODE(51, 2998c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 3008c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "dtx", V_88F6928), 3018c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "sdo", V_88F6928), 3028c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "dram", "deccerr", V_88F6920_PLUS), 3038c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "ua2", "txd", V_88F6920_PLUS)), 3048c2ecf20Sopenharmony_ci MPP_MODE(52, 3058c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 3068c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "pcie0", "rstout", V_88F6920_PLUS), 3078c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "int", V_88F6928), 3088c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "sdi", V_88F6928), 3098c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d6", V_88F6920_PLUS), 3108c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "i2c3", "sck", V_88F6920_PLUS)), 3118c2ecf20Sopenharmony_ci MPP_MODE(53, 3128c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 3138c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata1", "prsnt", V_88F6925_PLUS), 3148c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "sata0", "prsnt", V_88F6925_PLUS), 3158c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "rst", V_88F6928), 3168c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "bclk", V_88F6928), 3178c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d7", V_88F6920_PLUS), 3188c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "i2c3", "sda", V_88F6920_PLUS)), 3198c2ecf20Sopenharmony_ci MPP_MODE(54, 3208c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 3218c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6925_PLUS), 3228c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "sata1", "prsnt", V_88F6925_PLUS), 3238c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "pcie0", "rstout", V_88F6920_PLUS), 3248c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d3", V_88F6920_PLUS), 3258c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "ua3", "txd", V_88F6920_PLUS)), 3268c2ecf20Sopenharmony_ci MPP_MODE(55, 3278c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 3288c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua1", "cts", V_88F6920_PLUS), 3298c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "cs1", V_88F6920_PLUS), 3308c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d0", V_88F6920_PLUS), 3318c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6920_PLUS), 3328c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(7, "ua3", "rxd", V_88F6920_PLUS)), 3338c2ecf20Sopenharmony_ci MPP_MODE(56, 3348c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 3358c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua1", "rts", V_88F6920_PLUS), 3368c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "dram", "deccerr", V_88F6920_PLUS), 3378c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "mosi", V_88F6920_PLUS), 3388c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6920_PLUS)), 3398c2ecf20Sopenharmony_ci MPP_MODE(57, 3408c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 3418c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "sck", V_88F6920_PLUS), 3428c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "clk", V_88F6920_PLUS), 3438c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6920_PLUS)), 3448c2ecf20Sopenharmony_ci MPP_MODE(58, 3458c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 3468c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "i2c1", "sck", V_88F6920_PLUS), 3478c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(3, "pcie2", "clkreq", V_88F6920_PLUS), 3488c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "miso", V_88F6920_PLUS), 3498c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d1", V_88F6920_PLUS), 3508c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6920_PLUS)), 3518c2ecf20Sopenharmony_ci MPP_MODE(59, 3528c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), 3538c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(1, "pcie0", "rstout", V_88F6920_PLUS), 3548c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(2, "i2c1", "sda", V_88F6920_PLUS), 3558c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "cs0", V_88F6920_PLUS), 3568c2ecf20Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d2", V_88F6920_PLUS)), 3578c2ecf20Sopenharmony_ci}; 3588c2ecf20Sopenharmony_ci 3598c2ecf20Sopenharmony_cistatic struct mvebu_pinctrl_soc_info armada_39x_pinctrl_info; 3608c2ecf20Sopenharmony_ci 3618c2ecf20Sopenharmony_cistatic const struct of_device_id armada_39x_pinctrl_of_match[] = { 3628c2ecf20Sopenharmony_ci { 3638c2ecf20Sopenharmony_ci .compatible = "marvell,mv88f6920-pinctrl", 3648c2ecf20Sopenharmony_ci .data = (void *) V_88F6920, 3658c2ecf20Sopenharmony_ci }, 3668c2ecf20Sopenharmony_ci { 3678c2ecf20Sopenharmony_ci .compatible = "marvell,mv88f6925-pinctrl", 3688c2ecf20Sopenharmony_ci .data = (void *) V_88F6925, 3698c2ecf20Sopenharmony_ci }, 3708c2ecf20Sopenharmony_ci { 3718c2ecf20Sopenharmony_ci .compatible = "marvell,mv88f6928-pinctrl", 3728c2ecf20Sopenharmony_ci .data = (void *) V_88F6928, 3738c2ecf20Sopenharmony_ci }, 3748c2ecf20Sopenharmony_ci { }, 3758c2ecf20Sopenharmony_ci}; 3768c2ecf20Sopenharmony_ci 3778c2ecf20Sopenharmony_cistatic const struct mvebu_mpp_ctrl armada_39x_mpp_controls[] = { 3788c2ecf20Sopenharmony_ci MPP_FUNC_CTRL(0, 59, NULL, mvebu_mmio_mpp_ctrl), 3798c2ecf20Sopenharmony_ci}; 3808c2ecf20Sopenharmony_ci 3818c2ecf20Sopenharmony_cistatic struct pinctrl_gpio_range armada_39x_mpp_gpio_ranges[] = { 3828c2ecf20Sopenharmony_ci MPP_GPIO_RANGE(0, 0, 0, 32), 3838c2ecf20Sopenharmony_ci MPP_GPIO_RANGE(1, 32, 32, 28), 3848c2ecf20Sopenharmony_ci}; 3858c2ecf20Sopenharmony_ci 3868c2ecf20Sopenharmony_cistatic int armada_39x_pinctrl_probe(struct platform_device *pdev) 3878c2ecf20Sopenharmony_ci{ 3888c2ecf20Sopenharmony_ci struct mvebu_pinctrl_soc_info *soc = &armada_39x_pinctrl_info; 3898c2ecf20Sopenharmony_ci const struct of_device_id *match = 3908c2ecf20Sopenharmony_ci of_match_device(armada_39x_pinctrl_of_match, &pdev->dev); 3918c2ecf20Sopenharmony_ci 3928c2ecf20Sopenharmony_ci if (!match) 3938c2ecf20Sopenharmony_ci return -ENODEV; 3948c2ecf20Sopenharmony_ci 3958c2ecf20Sopenharmony_ci soc->variant = (unsigned) match->data & 0xff; 3968c2ecf20Sopenharmony_ci soc->controls = armada_39x_mpp_controls; 3978c2ecf20Sopenharmony_ci soc->ncontrols = ARRAY_SIZE(armada_39x_mpp_controls); 3988c2ecf20Sopenharmony_ci soc->gpioranges = armada_39x_mpp_gpio_ranges; 3998c2ecf20Sopenharmony_ci soc->ngpioranges = ARRAY_SIZE(armada_39x_mpp_gpio_ranges); 4008c2ecf20Sopenharmony_ci soc->modes = armada_39x_mpp_modes; 4018c2ecf20Sopenharmony_ci soc->nmodes = armada_39x_mpp_controls[0].npins; 4028c2ecf20Sopenharmony_ci 4038c2ecf20Sopenharmony_ci pdev->dev.platform_data = soc; 4048c2ecf20Sopenharmony_ci 4058c2ecf20Sopenharmony_ci return mvebu_pinctrl_simple_mmio_probe(pdev); 4068c2ecf20Sopenharmony_ci} 4078c2ecf20Sopenharmony_ci 4088c2ecf20Sopenharmony_cistatic struct platform_driver armada_39x_pinctrl_driver = { 4098c2ecf20Sopenharmony_ci .driver = { 4108c2ecf20Sopenharmony_ci .name = "armada-39x-pinctrl", 4118c2ecf20Sopenharmony_ci .of_match_table = of_match_ptr(armada_39x_pinctrl_of_match), 4128c2ecf20Sopenharmony_ci }, 4138c2ecf20Sopenharmony_ci .probe = armada_39x_pinctrl_probe, 4148c2ecf20Sopenharmony_ci}; 4158c2ecf20Sopenharmony_cibuiltin_platform_driver(armada_39x_pinctrl_driver); 416