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