Add pin configuration and pinmux support for UniPhier ProXstream2
SoC.

Signed-off-by: Masahiro Yamada <[email protected]>
---

 drivers/pinctrl/uniphier/Kconfig               |   6 ++
 drivers/pinctrl/uniphier/Makefile              |   1 +
 drivers/pinctrl/uniphier/pinctrl-proxstream2.c | 103 +++++++++++++++++++++++++
 3 files changed, 110 insertions(+)
 create mode 100644 drivers/pinctrl/uniphier/pinctrl-proxstream2.c

diff --git a/drivers/pinctrl/uniphier/Kconfig b/drivers/pinctrl/uniphier/Kconfig
index 9d3065d..7f729b6 100644
--- a/drivers/pinctrl/uniphier/Kconfig
+++ b/drivers/pinctrl/uniphier/Kconfig
@@ -27,4 +27,10 @@ config PINCTRL_UNIPHIER_PH1_PRO5
        default y
        select PINCTRL_UNIPHIER_CORE
 
+config PINCTRL_UNIPHIER_PROXSTREAM2
+       bool "UniPhier ProXstream2 SoC pinctrl driver"
+       depends on MACH_PROXSTREAM2
+       default y
+       select PINCTRL_UNIPHIER_CORE
+
 endif
diff --git a/drivers/pinctrl/uniphier/Makefile 
b/drivers/pinctrl/uniphier/Makefile
index b0cd3e8..aed038c 100644
--- a/drivers/pinctrl/uniphier/Makefile
+++ b/drivers/pinctrl/uniphier/Makefile
@@ -4,3 +4,4 @@ obj-$(CONFIG_PINCTRL_UNIPHIER_PH1_LD4)          += 
pinctrl-ph1-ld4.o
 obj-$(CONFIG_PINCTRL_UNIPHIER_PH1_PRO4)                += pinctrl-ph1-pro4.o
 obj-$(CONFIG_PINCTRL_UNIPHIER_PH1_SLD8)                += pinctrl-ph1-sld8.o
 obj-$(CONFIG_PINCTRL_UNIPHIER_PH1_PRO5)                += pinctrl-ph1-pro5.o
+obj-$(CONFIG_PINCTRL_UNIPHIER_PROXSTREAM2)     += pinctrl-proxstream2.o
diff --git a/drivers/pinctrl/uniphier/pinctrl-proxstream2.c 
b/drivers/pinctrl/uniphier/pinctrl-proxstream2.c
new file mode 100644
index 0000000..981ad7e
--- /dev/null
+++ b/drivers/pinctrl/uniphier/pinctrl-proxstream2.c
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2015 Masahiro Yamada <[email protected]>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <dm/device.h>
+#include <dm/pinctrl.h>
+
+#include "pinctrl-uniphier.h"
+
+static const struct uniphier_pmx_data i2c0_pmx[] = {{109, 8}, {110, 8}};
+static const struct uniphier_pmx_data i2c1_pmx[] = {{111, 8}, {112, 8}};
+static const struct uniphier_pmx_data i2c2_pmx[] = {{171, 8}, {172, 8}};
+static const struct uniphier_pmx_data i2c3_pmx[] = {{159, 8}, {160, 8}};
+static const struct uniphier_pmx_data i2c5_pmx[] = {{183, 11}, {184, 11}};
+static const struct uniphier_pmx_data i2c6_pmx[] = {{185, 11}, {186, 11}};
+static const struct uniphier_pmx_data nand_pmx[] = {
+       {30, 8}, {31, 8}, {32, 8}, {33, 8}, {34, 8}, {35, 8}, {36, 8}, {39, 8},
+       {40, 8}, {41, 8}, {42, 8}, {43, 8}, {44, 8}, {45, 8}, {46, 8},
+};
+static const struct uniphier_pmx_data nand_cs1_pmx[] = {{37, 8}, {38, 8}};
+static const struct uniphier_pmx_data uart0_pmx[] = {{217, 8}, {218, 8}};
+static const struct uniphier_pmx_data uart0b_pmx[] = {{179, 10}, {180, 10}};
+static const struct uniphier_pmx_data uart1_pmx[] = {{115, 8}, {116, 8}};
+static const struct uniphier_pmx_data uart2_pmx[] = {{113, 8}, {114, 8}};
+static const struct uniphier_pmx_data uart3_pmx[] = {{219, 8}, {220, 8}};
+static const struct uniphier_pmx_data uart3b_pmx[] = {{181, 10}, {182, 10}};
+static const struct uniphier_pmx_data usb0_pmx[] = {{56, 8}, {57, 8}};
+static const struct uniphier_pmx_data usb1_pmx[] = {{58, 8}, {59, 8}};
+static const struct uniphier_pmx_data usb2_pmx[] = {{60, 8}, {61, 8}};
+static const struct uniphier_pmx_data usb3_pmx[] = {{62, 8}, {63, 8}};
+
+static const struct uniphier_pinctrl_group proxstream2_groups[] = {
+       UNIPHIER_PINCTRL_GROUP(i2c0),
+       UNIPHIER_PINCTRL_GROUP(i2c1),
+       UNIPHIER_PINCTRL_GROUP(i2c2),
+       UNIPHIER_PINCTRL_GROUP(i2c3),
+       UNIPHIER_PINCTRL_GROUP(i2c5),
+       UNIPHIER_PINCTRL_GROUP(i2c6),
+       UNIPHIER_PINCTRL_GROUP(nand),
+       UNIPHIER_PINCTRL_GROUP(nand_cs1),
+       UNIPHIER_PINCTRL_GROUP(uart0),
+       UNIPHIER_PINCTRL_GROUP(uart0b),
+       UNIPHIER_PINCTRL_GROUP(uart1),
+       UNIPHIER_PINCTRL_GROUP(uart2),
+       UNIPHIER_PINCTRL_GROUP(uart3),
+       UNIPHIER_PINCTRL_GROUP(uart3b),
+       UNIPHIER_PINCTRL_GROUP(usb0),
+       UNIPHIER_PINCTRL_GROUP(usb1),
+       UNIPHIER_PINCTRL_GROUP(usb2),
+       UNIPHIER_PINCTRL_GROUP(usb3),
+};
+
+static const char * const proxstream2_functions[] = {
+       "i2c0",
+       "i2c1",
+       "i2c2",
+       "i2c3",
+       "i2c5",
+       "i2c6",
+       "nand",
+       "uart0",
+       "uart0b",
+       "uart1",
+       "uart2",
+       "uart3",
+       "uart3b",
+       "usb0",
+       "usb1",
+       "usb2",
+       "usb3",
+};
+
+static struct uniphier_pinctrl_socdata proxstream2_pinctrl_socdata = {
+       .groups = proxstream2_groups,
+       .groups_count = ARRAY_SIZE(proxstream2_groups),
+       .functions = proxstream2_functions,
+       .functions_count = ARRAY_SIZE(proxstream2_functions),
+       .mux_bits = 8,
+       .reg_stride = 4,
+       .load_pinctrl = false,
+};
+
+static int proxstream2_pinctrl_probe(struct udevice *dev)
+{
+       return uniphier_pinctrl_probe(dev, &proxstream2_pinctrl_socdata);
+}
+
+static const struct udevice_id proxstream2_pinctrl_match[] = {
+       { .compatible = "socionext,proxstream2-pinctrl" },
+       { /* sentinel */ }
+};
+
+U_BOOT_DRIVER(proxstream2_pinctrl) = {
+       .name = "proxstream2-pinctrl",
+       .id = UCLASS_PINCTRL,
+       .of_match = of_match_ptr(proxstream2_pinctrl_match),
+       .probe = proxstream2_pinctrl_probe,
+       .remove = uniphier_pinctrl_remove,
+       .priv_auto_alloc_size = sizeof(struct uniphier_pinctrl_priv),
+       .ops = &uniphier_pinctrl_ops,
+};
-- 
1.9.1

_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to