162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Marvell Armada 380/385 pinctrl driver based on mvebu pinctrl core 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (C) 2013 Marvell 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 862306a36Sopenharmony_ci */ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#include <linux/err.h> 1162306a36Sopenharmony_ci#include <linux/init.h> 1262306a36Sopenharmony_ci#include <linux/io.h> 1362306a36Sopenharmony_ci#include <linux/platform_device.h> 1462306a36Sopenharmony_ci#include <linux/of.h> 1562306a36Sopenharmony_ci#include <linux/of_device.h> 1662306a36Sopenharmony_ci#include <linux/pinctrl/pinctrl.h> 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci#include "pinctrl-mvebu.h" 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_cienum { 2162306a36Sopenharmony_ci V_88F6810 = BIT(0), 2262306a36Sopenharmony_ci V_88F6820 = BIT(1), 2362306a36Sopenharmony_ci V_88F6828 = BIT(2), 2462306a36Sopenharmony_ci V_88F6810_PLUS = (V_88F6810 | V_88F6820 | V_88F6828), 2562306a36Sopenharmony_ci V_88F6820_PLUS = (V_88F6820 | V_88F6828), 2662306a36Sopenharmony_ci}; 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_cistatic struct mvebu_mpp_mode armada_38x_mpp_modes[] = { 2962306a36Sopenharmony_ci MPP_MODE(0, 3062306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 3162306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua0", "rxd", V_88F6810_PLUS)), 3262306a36Sopenharmony_ci MPP_MODE(1, 3362306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 3462306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua0", "txd", V_88F6810_PLUS)), 3562306a36Sopenharmony_ci MPP_MODE(2, 3662306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 3762306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "i2c0", "sck", V_88F6810_PLUS)), 3862306a36Sopenharmony_ci MPP_MODE(3, 3962306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 4062306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "i2c0", "sda", V_88F6810_PLUS)), 4162306a36Sopenharmony_ci MPP_MODE(4, 4262306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 4362306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge", "mdc", V_88F6810_PLUS), 4462306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ua1", "txd", V_88F6810_PLUS), 4562306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "rts", V_88F6810_PLUS)), 4662306a36Sopenharmony_ci MPP_MODE(5, 4762306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 4862306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge", "mdio", V_88F6810_PLUS), 4962306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ua1", "rxd", V_88F6810_PLUS), 5062306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "cts", V_88F6810_PLUS)), 5162306a36Sopenharmony_ci MPP_MODE(6, 5262306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 5362306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "txclkout", V_88F6810_PLUS), 5462306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge0", "crs", V_88F6810_PLUS), 5562306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "cs3", V_88F6810_PLUS)), 5662306a36Sopenharmony_ci MPP_MODE(7, 5762306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 5862306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "txd0", V_88F6810_PLUS), 5962306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad9", V_88F6810_PLUS)), 6062306a36Sopenharmony_ci MPP_MODE(8, 6162306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 6262306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "txd1", V_88F6810_PLUS), 6362306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad10", V_88F6810_PLUS)), 6462306a36Sopenharmony_ci MPP_MODE(9, 6562306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 6662306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "txd2", V_88F6810_PLUS), 6762306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad11", V_88F6810_PLUS)), 6862306a36Sopenharmony_ci MPP_MODE(10, 6962306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 7062306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "txd3", V_88F6810_PLUS), 7162306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad12", V_88F6810_PLUS)), 7262306a36Sopenharmony_ci MPP_MODE(11, 7362306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 7462306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "txctl", V_88F6810_PLUS), 7562306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad13", V_88F6810_PLUS)), 7662306a36Sopenharmony_ci MPP_MODE(12, 7762306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 7862306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "rxd0", V_88F6810_PLUS), 7962306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "pcie0", "rstout", V_88F6810_PLUS), 8062306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi0", "cs1", V_88F6810_PLUS), 8162306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad14", V_88F6810_PLUS), 8262306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "pcie3", "clkreq", V_88F6810_PLUS)), 8362306a36Sopenharmony_ci MPP_MODE(13, 8462306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 8562306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "rxd1", V_88F6810_PLUS), 8662306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "pcie0", "clkreq", V_88F6810_PLUS), 8762306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "pcie1", "clkreq", V_88F6820_PLUS), 8862306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi0", "cs2", V_88F6810_PLUS), 8962306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad15", V_88F6810_PLUS), 9062306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "pcie2", "clkreq", V_88F6810_PLUS)), 9162306a36Sopenharmony_ci MPP_MODE(14, 9262306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 9362306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "rxd2", V_88F6810_PLUS), 9462306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ptp", "clk", V_88F6810_PLUS), 9562306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "dram", "vttctrl", V_88F6810_PLUS), 9662306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi0", "cs3", V_88F6810_PLUS), 9762306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "we1", V_88F6810_PLUS), 9862306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "pcie3", "clkreq", V_88F6810_PLUS)), 9962306a36Sopenharmony_ci MPP_MODE(15, 10062306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 10162306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "rxd3", V_88F6810_PLUS), 10262306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge", "mdc slave", V_88F6810_PLUS), 10362306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "pcie0", "rstout", V_88F6810_PLUS), 10462306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi0", "mosi", V_88F6810_PLUS)), 10562306a36Sopenharmony_ci MPP_MODE(16, 10662306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 10762306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "rxctl", V_88F6810_PLUS), 10862306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge", "mdio slave", V_88F6810_PLUS), 10962306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "dram", "deccerr", V_88F6810_PLUS), 11062306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi0", "miso", V_88F6810_PLUS), 11162306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "pcie0", "clkreq", V_88F6810_PLUS), 11262306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "pcie1", "clkreq", V_88F6820_PLUS)), 11362306a36Sopenharmony_ci MPP_MODE(17, 11462306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 11562306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "rxclk", V_88F6810_PLUS), 11662306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ptp", "clk", V_88F6810_PLUS), 11762306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua1", "rxd", V_88F6810_PLUS), 11862306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi0", "sck", V_88F6810_PLUS), 11962306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sata1", "prsnt", V_88F6810_PLUS), 12062306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "sata0", "prsnt", V_88F6810_PLUS)), 12162306a36Sopenharmony_ci MPP_MODE(18, 12262306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 12362306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "rxerr", V_88F6810_PLUS), 12462306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ptp", "trig", V_88F6810_PLUS), 12562306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua1", "txd", V_88F6810_PLUS), 12662306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi0", "cs0", V_88F6810_PLUS)), 12762306a36Sopenharmony_ci MPP_MODE(19, 12862306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 12962306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "col", V_88F6810_PLUS), 13062306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ptp", "evreq", V_88F6810_PLUS), 13162306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ge0", "txerr", V_88F6810_PLUS), 13262306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sata1", "prsnt", V_88F6810_PLUS), 13362306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "ua0", "cts", V_88F6810_PLUS), 13462306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6810_PLUS)), 13562306a36Sopenharmony_ci MPP_MODE(20, 13662306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 13762306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ge0", "txclk", V_88F6810_PLUS), 13862306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ptp", "clk", V_88F6810_PLUS), 13962306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sata0", "prsnt", V_88F6810_PLUS), 14062306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "ua0", "rts", V_88F6810_PLUS), 14162306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6810_PLUS)), 14262306a36Sopenharmony_ci MPP_MODE(21, 14362306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 14462306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "cs1", V_88F6810_PLUS), 14562306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "rxd0", V_88F6810_PLUS), 14662306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "sata0", "prsnt", V_88F6810_PLUS), 14762306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "cmd", V_88F6810_PLUS), 14862306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "bootcs", V_88F6810_PLUS), 14962306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "sata1", "prsnt", V_88F6810_PLUS)), 15062306a36Sopenharmony_ci MPP_MODE(22, 15162306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 15262306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "mosi", V_88F6810_PLUS), 15362306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad0", V_88F6810_PLUS)), 15462306a36Sopenharmony_ci MPP_MODE(23, 15562306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 15662306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "sck", V_88F6810_PLUS), 15762306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad2", V_88F6810_PLUS)), 15862306a36Sopenharmony_ci MPP_MODE(24, 15962306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 16062306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "miso", V_88F6810_PLUS), 16162306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ua0", "cts", V_88F6810_PLUS), 16262306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua1", "rxd", V_88F6810_PLUS), 16362306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d4", V_88F6810_PLUS), 16462306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ready", V_88F6810_PLUS)), 16562306a36Sopenharmony_ci MPP_MODE(25, 16662306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 16762306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "cs0", V_88F6810_PLUS), 16862306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ua0", "rts", V_88F6810_PLUS), 16962306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua1", "txd", V_88F6810_PLUS), 17062306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d5", V_88F6810_PLUS), 17162306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "cs0", V_88F6810_PLUS)), 17262306a36Sopenharmony_ci MPP_MODE(26, 17362306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 17462306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "cs2", V_88F6810_PLUS), 17562306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "i2c1", "sck", V_88F6810_PLUS), 17662306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d6", V_88F6810_PLUS), 17762306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "cs1", V_88F6810_PLUS)), 17862306a36Sopenharmony_ci MPP_MODE(27, 17962306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 18062306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "spi0", "cs3", V_88F6810_PLUS), 18162306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "txclkout", V_88F6810_PLUS), 18262306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "i2c1", "sda", V_88F6810_PLUS), 18362306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d7", V_88F6810_PLUS), 18462306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "cs2", V_88F6810_PLUS)), 18562306a36Sopenharmony_ci MPP_MODE(28, 18662306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 18762306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "txd0", V_88F6810_PLUS), 18862306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "clk", V_88F6810_PLUS), 18962306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad5", V_88F6810_PLUS)), 19062306a36Sopenharmony_ci MPP_MODE(29, 19162306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 19262306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "txd1", V_88F6810_PLUS), 19362306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ale0", V_88F6810_PLUS)), 19462306a36Sopenharmony_ci MPP_MODE(30, 19562306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 19662306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "txd2", V_88F6810_PLUS), 19762306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "oe", V_88F6810_PLUS)), 19862306a36Sopenharmony_ci MPP_MODE(31, 19962306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 20062306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "txd3", V_88F6810_PLUS), 20162306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ale1", V_88F6810_PLUS)), 20262306a36Sopenharmony_ci MPP_MODE(32, 20362306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 20462306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "txctl", V_88F6810_PLUS), 20562306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "we0", V_88F6810_PLUS)), 20662306a36Sopenharmony_ci MPP_MODE(33, 20762306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 20862306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "dram", "deccerr", V_88F6810_PLUS), 20962306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad3", V_88F6810_PLUS)), 21062306a36Sopenharmony_ci MPP_MODE(34, 21162306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 21262306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad1", V_88F6810_PLUS)), 21362306a36Sopenharmony_ci MPP_MODE(35, 21462306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 21562306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ref", "clk_out1", V_88F6810_PLUS), 21662306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "a1", V_88F6810_PLUS)), 21762306a36Sopenharmony_ci MPP_MODE(36, 21862306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 21962306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ptp", "trig", V_88F6810_PLUS), 22062306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "a0", V_88F6810_PLUS)), 22162306a36Sopenharmony_ci MPP_MODE(37, 22262306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 22362306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ptp", "clk", V_88F6810_PLUS), 22462306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "rxclk", V_88F6810_PLUS), 22562306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d3", V_88F6810_PLUS), 22662306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad8", V_88F6810_PLUS)), 22762306a36Sopenharmony_ci MPP_MODE(38, 22862306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 22962306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ptp", "evreq", V_88F6810_PLUS), 23062306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "rxd1", V_88F6810_PLUS), 23162306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ref", "clk_out0", V_88F6810_PLUS), 23262306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d0", V_88F6810_PLUS), 23362306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad4", V_88F6810_PLUS)), 23462306a36Sopenharmony_ci MPP_MODE(39, 23562306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 23662306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "i2c1", "sck", V_88F6810_PLUS), 23762306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "rxd2", V_88F6810_PLUS), 23862306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "cts", V_88F6810_PLUS), 23962306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d1", V_88F6810_PLUS), 24062306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "a2", V_88F6810_PLUS)), 24162306a36Sopenharmony_ci MPP_MODE(40, 24262306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 24362306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "i2c1", "sda", V_88F6810_PLUS), 24462306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "rxd3", V_88F6810_PLUS), 24562306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "rts", V_88F6810_PLUS), 24662306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sd0", "d2", V_88F6810_PLUS), 24762306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad6", V_88F6810_PLUS)), 24862306a36Sopenharmony_ci MPP_MODE(41, 24962306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 25062306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua1", "rxd", V_88F6810_PLUS), 25162306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge1", "rxctl", V_88F6810_PLUS), 25262306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "cts", V_88F6810_PLUS), 25362306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "cs3", V_88F6810_PLUS), 25462306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "burst/last", V_88F6810_PLUS), 25562306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "nand", "rb0", V_88F6810_PLUS)), 25662306a36Sopenharmony_ci MPP_MODE(42, 25762306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 25862306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua1", "txd", V_88F6810_PLUS), 25962306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "ua0", "rts", V_88F6810_PLUS), 26062306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "ad7", V_88F6810_PLUS)), 26162306a36Sopenharmony_ci MPP_MODE(43, 26262306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 26362306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "pcie0", "clkreq", V_88F6810_PLUS), 26462306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "dram", "vttctrl", V_88F6810_PLUS), 26562306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "dram", "deccerr", V_88F6810_PLUS), 26662306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "cs2", V_88F6810_PLUS), 26762306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dev", "clkout", V_88F6810_PLUS), 26862306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "nand", "rb1", V_88F6810_PLUS)), 26962306a36Sopenharmony_ci MPP_MODE(44, 27062306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 27162306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6810_PLUS), 27262306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "sata1", "prsnt", V_88F6810_PLUS), 27362306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "sata2", "prsnt", V_88F6828), 27462306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "sata3", "prsnt", V_88F6828)), 27562306a36Sopenharmony_ci MPP_MODE(45, 27662306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 27762306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ref", "clk_out0", V_88F6810_PLUS), 27862306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "pcie0", "rstout", V_88F6810_PLUS), 27962306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6810_PLUS)), 28062306a36Sopenharmony_ci MPP_MODE(46, 28162306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 28262306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ref", "clk_out1", V_88F6810_PLUS), 28362306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "pcie0", "rstout", V_88F6810_PLUS), 28462306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6810_PLUS)), 28562306a36Sopenharmony_ci MPP_MODE(47, 28662306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 28762306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6810_PLUS), 28862306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "sata1", "prsnt", V_88F6810_PLUS), 28962306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "sata2", "prsnt", V_88F6828), 29062306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sata3", "prsnt", V_88F6828)), 29162306a36Sopenharmony_ci MPP_MODE(48, 29262306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 29362306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6810_PLUS), 29462306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "dram", "vttctrl", V_88F6810_PLUS), 29562306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "pclk", V_88F6810_PLUS), 29662306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "mclk", V_88F6810_PLUS), 29762306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d4", V_88F6810_PLUS), 29862306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "pcie0", "clkreq", V_88F6810_PLUS)), 29962306a36Sopenharmony_ci MPP_MODE(49, 30062306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 30162306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata2", "prsnt", V_88F6828), 30262306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "sata3", "prsnt", V_88F6828), 30362306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "fsync", V_88F6810_PLUS), 30462306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "lrclk", V_88F6810_PLUS), 30562306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d5", V_88F6810_PLUS), 30662306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "pcie1", "clkreq", V_88F6820_PLUS)), 30762306a36Sopenharmony_ci MPP_MODE(50, 30862306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 30962306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "pcie0", "rstout", V_88F6810_PLUS), 31062306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "drx", V_88F6810_PLUS), 31162306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "extclk", V_88F6810_PLUS), 31262306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "cmd", V_88F6810_PLUS)), 31362306a36Sopenharmony_ci MPP_MODE(51, 31462306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 31562306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "dtx", V_88F6810_PLUS), 31662306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "sdo", V_88F6810_PLUS), 31762306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "dram", "deccerr", V_88F6810_PLUS), 31862306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "ptp", "trig", V_88F6810_PLUS)), 31962306a36Sopenharmony_ci MPP_MODE(52, 32062306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 32162306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "pcie0", "rstout", V_88F6810_PLUS), 32262306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "int", V_88F6810_PLUS), 32362306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "sdi", V_88F6810_PLUS), 32462306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d6", V_88F6810_PLUS), 32562306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "ptp", "clk", V_88F6810_PLUS)), 32662306a36Sopenharmony_ci MPP_MODE(53, 32762306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 32862306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata1", "prsnt", V_88F6810_PLUS), 32962306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "sata0", "prsnt", V_88F6810_PLUS), 33062306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "tdm", "rst", V_88F6810_PLUS), 33162306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "audio", "bclk", V_88F6810_PLUS), 33262306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d7", V_88F6810_PLUS), 33362306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "ptp", "evreq", V_88F6810_PLUS)), 33462306a36Sopenharmony_ci MPP_MODE(54, 33562306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 33662306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6810_PLUS), 33762306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "sata1", "prsnt", V_88F6810_PLUS), 33862306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "pcie0", "rstout", V_88F6810_PLUS), 33962306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "ge0", "txerr", V_88F6810_PLUS), 34062306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d3", V_88F6810_PLUS)), 34162306a36Sopenharmony_ci MPP_MODE(55, 34262306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 34362306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua1", "cts", V_88F6810_PLUS), 34462306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge", "mdio", V_88F6810_PLUS), 34562306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "pcie1", "clkreq", V_88F6820_PLUS), 34662306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "cs1", V_88F6810_PLUS), 34762306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d0", V_88F6810_PLUS), 34862306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6810_PLUS)), 34962306a36Sopenharmony_ci MPP_MODE(56, 35062306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 35162306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "ua1", "rts", V_88F6810_PLUS), 35262306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "ge", "mdc", V_88F6810_PLUS), 35362306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "dram", "deccerr", V_88F6810_PLUS), 35462306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "mosi", V_88F6810_PLUS), 35562306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6810_PLUS)), 35662306a36Sopenharmony_ci MPP_MODE(57, 35762306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 35862306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "sck", V_88F6810_PLUS), 35962306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "clk", V_88F6810_PLUS), 36062306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6810_PLUS)), 36162306a36Sopenharmony_ci MPP_MODE(58, 36262306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 36362306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "pcie1", "clkreq", V_88F6820_PLUS), 36462306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "i2c1", "sck", V_88F6810_PLUS), 36562306a36Sopenharmony_ci MPP_VAR_FUNCTION(3, "pcie2", "clkreq", V_88F6810_PLUS), 36662306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "miso", V_88F6810_PLUS), 36762306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d1", V_88F6810_PLUS), 36862306a36Sopenharmony_ci MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6810_PLUS)), 36962306a36Sopenharmony_ci MPP_MODE(59, 37062306a36Sopenharmony_ci MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6810_PLUS), 37162306a36Sopenharmony_ci MPP_VAR_FUNCTION(1, "pcie0", "rstout", V_88F6810_PLUS), 37262306a36Sopenharmony_ci MPP_VAR_FUNCTION(2, "i2c1", "sda", V_88F6810_PLUS), 37362306a36Sopenharmony_ci MPP_VAR_FUNCTION(4, "spi1", "cs0", V_88F6810_PLUS), 37462306a36Sopenharmony_ci MPP_VAR_FUNCTION(5, "sd0", "d2", V_88F6810_PLUS)), 37562306a36Sopenharmony_ci}; 37662306a36Sopenharmony_ci 37762306a36Sopenharmony_cistatic struct mvebu_pinctrl_soc_info armada_38x_pinctrl_info; 37862306a36Sopenharmony_ci 37962306a36Sopenharmony_cistatic const struct of_device_id armada_38x_pinctrl_of_match[] = { 38062306a36Sopenharmony_ci { 38162306a36Sopenharmony_ci .compatible = "marvell,mv88f6810-pinctrl", 38262306a36Sopenharmony_ci .data = (void *) V_88F6810, 38362306a36Sopenharmony_ci }, 38462306a36Sopenharmony_ci { 38562306a36Sopenharmony_ci .compatible = "marvell,mv88f6820-pinctrl", 38662306a36Sopenharmony_ci .data = (void *) V_88F6820, 38762306a36Sopenharmony_ci }, 38862306a36Sopenharmony_ci { 38962306a36Sopenharmony_ci .compatible = "marvell,mv88f6828-pinctrl", 39062306a36Sopenharmony_ci .data = (void *) V_88F6828, 39162306a36Sopenharmony_ci }, 39262306a36Sopenharmony_ci { }, 39362306a36Sopenharmony_ci}; 39462306a36Sopenharmony_ci 39562306a36Sopenharmony_cistatic const struct mvebu_mpp_ctrl armada_38x_mpp_controls[] = { 39662306a36Sopenharmony_ci MPP_FUNC_CTRL(0, 59, NULL, mvebu_mmio_mpp_ctrl), 39762306a36Sopenharmony_ci}; 39862306a36Sopenharmony_ci 39962306a36Sopenharmony_cistatic struct pinctrl_gpio_range armada_38x_mpp_gpio_ranges[] = { 40062306a36Sopenharmony_ci MPP_GPIO_RANGE(0, 0, 0, 32), 40162306a36Sopenharmony_ci MPP_GPIO_RANGE(1, 32, 32, 28), 40262306a36Sopenharmony_ci}; 40362306a36Sopenharmony_ci 40462306a36Sopenharmony_cistatic int armada_38x_pinctrl_probe(struct platform_device *pdev) 40562306a36Sopenharmony_ci{ 40662306a36Sopenharmony_ci struct mvebu_pinctrl_soc_info *soc = &armada_38x_pinctrl_info; 40762306a36Sopenharmony_ci const struct of_device_id *match = 40862306a36Sopenharmony_ci of_match_device(armada_38x_pinctrl_of_match, &pdev->dev); 40962306a36Sopenharmony_ci 41062306a36Sopenharmony_ci if (!match) 41162306a36Sopenharmony_ci return -ENODEV; 41262306a36Sopenharmony_ci 41362306a36Sopenharmony_ci soc->variant = (unsigned) match->data & 0xff; 41462306a36Sopenharmony_ci soc->controls = armada_38x_mpp_controls; 41562306a36Sopenharmony_ci soc->ncontrols = ARRAY_SIZE(armada_38x_mpp_controls); 41662306a36Sopenharmony_ci soc->gpioranges = armada_38x_mpp_gpio_ranges; 41762306a36Sopenharmony_ci soc->ngpioranges = ARRAY_SIZE(armada_38x_mpp_gpio_ranges); 41862306a36Sopenharmony_ci soc->modes = armada_38x_mpp_modes; 41962306a36Sopenharmony_ci soc->nmodes = armada_38x_mpp_controls[0].npins; 42062306a36Sopenharmony_ci 42162306a36Sopenharmony_ci pdev->dev.platform_data = soc; 42262306a36Sopenharmony_ci 42362306a36Sopenharmony_ci return mvebu_pinctrl_simple_mmio_probe(pdev); 42462306a36Sopenharmony_ci} 42562306a36Sopenharmony_ci 42662306a36Sopenharmony_cistatic struct platform_driver armada_38x_pinctrl_driver = { 42762306a36Sopenharmony_ci .driver = { 42862306a36Sopenharmony_ci .name = "armada-38x-pinctrl", 42962306a36Sopenharmony_ci .of_match_table = of_match_ptr(armada_38x_pinctrl_of_match), 43062306a36Sopenharmony_ci }, 43162306a36Sopenharmony_ci .probe = armada_38x_pinctrl_probe, 43262306a36Sopenharmony_ci}; 43362306a36Sopenharmony_cibuiltin_platform_driver(armada_38x_pinctrl_driver); 434