From patchwork Fri Oct 13 10:21:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 115745 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp568257qgn; Fri, 13 Oct 2017 03:36:50 -0700 (PDT) X-Google-Smtp-Source: AOwi7QA9mgR7sTMQLTPZoKRvN2Odhyy2yeVPgY1gibR3HuZNCOSdXuEehsqh0sqwHy+oEe/Oey+Y X-Received: by 10.80.164.72 with SMTP id v8mr1520586edb.99.1507891010783; Fri, 13 Oct 2017 03:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507891010; cv=none; d=google.com; s=arc-20160816; b=ia+B3X4Sxe+Rv1Jb3Y2qzWJc/A5lY0PU8HRRhfnrLy2+jaMX8KdSSdqRDvB6RxDOhN 3+w7MIohuktN5MnufVXRAf/cc4S44dDZkBtXnI3JS1v+CPxcTW0gGtGVYhRe+G5MT+vK y3HRWUTpqNoTiSIGE5A8VeX4s3pQlAhWqDwVN+g5BBIDQel7UdKyk0FtdTPN5RcuM/O5 dtTvbxAWPSmH6W0X8zTEaV6WYT5VqZYyevyHuS3ycUhf76CfHbDY9tUWPqImfN08zQx3 YUjJd3eGiouMPFQxZv24ov6+sT292T4vE/IvzlRtV2Nfg2Vp8UuHnRJadDw4GPiLsrvn CfIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=tUMKWkp9z6w/S9CJyurLDtiJ64Ff/ds8RCxFANnxwKI=; b=IvREAzpdHJIu03lvC6+qmQhl2AIyGeZp73SoFC1hJD0Eq2ZcFaMdkRIVdV2a1i6c+I JYUCTKYWYkui33+raH9Wd6K299p509uyVDspX3KAFV0kjWv8eHcnM/J35Z9S8LqClEQY M9uJcscEX2pxQYLvbhD2KVUAJHOuWzihbV7NfO4KlN+E7JfwExgmghyWFP4iSRHGcMsX w9Jw+LkcU+EGTVLBEyYnIHGxsSozXu8PABM+ICeA2XFA4xkNvba9y5C1dIB9kNTiAXCP BmwQSmp09Qg4WpncJF13FRwAzjMuoLyEnxa3RImn2xXhIEoh4QDJDjV+drjxAopvZrdy 2NRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=WaxT05bQ; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 65si702796edm.326.2017.10.13.03.36.50; Fri, 13 Oct 2017 03:36:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=WaxT05bQ; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 65FACC21FBA; Fri, 13 Oct 2017 10:29:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 1FB4DC21FB6; Fri, 13 Oct 2017 10:22:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6C8A0C21F03; Fri, 13 Oct 2017 10:22:41 +0000 (UTC) Received: from conuserg-12.nifty.com (conuserg-12.nifty.com [210.131.2.79]) by lists.denx.de (Postfix) with ESMTPS id B1AACC21F16 for ; Fri, 13 Oct 2017 10:22:39 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id v9DAMGx8009903; Fri, 13 Oct 2017 19:22:19 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com v9DAMGx8009903 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1507890139; bh=a3kb7OuPmYkwV3liWEDMSipyco79dBlciiWw5Hkd92g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WaxT05bQDsugKv7EIsRl0f0zu2hYJh9ACPXS88LRh30Sm+ChemeXfM4eNZgca4dnZ rxR2YwLHS/0z12MUKy4XnRG7a5szpPTMt9SAeemqPjavkoddgEAqLo+3nPuECsOiOu hoYMP8dm0s52eF2hizYzhRt27NLa3+WfzHOo4XN1lZEG0MeL/D0Kn9cQM1ZeGAnmZN pRKHrIATpeJ2G7EVWv6xZHF4iiopw5oDUTRBzFQDQC0N9dmL++W3nCGCL3shjybG9/ 62K4azQxE6jPRNuK8N+iNlWKIpUWWmgMQzIdW4sRs5S5OFu+ZLBFk5cMwEeHPZ5uhn nb6lLpsi9zUIQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Fri, 13 Oct 2017 19:21:54 +0900 Message-Id: <1507890129-1543-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507890129-1543-1-git-send-email-yamada.masahiro@socionext.com> References: <1507890129-1543-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 05/20] pinctrl: uniphier: simplify input enable and delete pin arrays X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The pin data are implemented for old SoCs to specify the bit shift of the IECTRL register. They are not wortwhile given the required memory footprint. Delete all the pin data and enable all bits of the IECTRL register. Signed-off-by: Masahiro Yamada --- drivers/pinctrl/uniphier/pinctrl-uniphier-core.c | 17 +++----------- drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c | 16 ------------- drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c | 5 ---- drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c | 15 ------------ drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c | 9 ------- drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c | 30 ------------------------ 6 files changed, 3 insertions(+), 89 deletions(-) diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c index d314482..215b19e 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -81,9 +82,6 @@ static int uniphier_pinconf_input_enable_legacy(struct udevice *dev, unsigned int pin, int enable) { struct uniphier_pinctrl_priv *priv = dev_get_priv(dev); - int pins_count = priv->socdata->pins_count; - const struct uniphier_pinctrl_pin *pins = priv->socdata->pins; - int i; /* * Multiple pins share one input enable, per-pin disabling is @@ -92,17 +90,8 @@ static int uniphier_pinconf_input_enable_legacy(struct udevice *dev, if (!enable) return -EINVAL; - for (i = 0; i < pins_count; i++) { - if (pins[i].number == pin) { - unsigned int iectrl; - u32 tmp; - - iectrl = uniphier_pin_get_iectrl(pins[i].data); - tmp = readl(priv->base + UNIPHIER_PINCTRL_IECTRL); - tmp |= 1 << iectrl; - writel(tmp, priv->base + UNIPHIER_PINCTRL_IECTRL); - } - } + /* Set all bits instead of having a bunch of pin data */ + writel(U32_MAX, priv->base + UNIPHIER_PINCTRL_IECTRL); return 0; } diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c index 709b005..7eb693d 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c @@ -11,20 +11,6 @@ #include "pinctrl-uniphier.h" -static const struct uniphier_pinctrl_pin uniphier_ld4_pins[] = { - UNIPHIER_PINCTRL_PIN(53, 0), - UNIPHIER_PINCTRL_PIN(54, 0), - UNIPHIER_PINCTRL_PIN(55, 0), - UNIPHIER_PINCTRL_PIN(56, 0), - UNIPHIER_PINCTRL_PIN(67, 0), - UNIPHIER_PINCTRL_PIN(68, 0), - UNIPHIER_PINCTRL_PIN(69, 0), - UNIPHIER_PINCTRL_PIN(70, 0), - UNIPHIER_PINCTRL_PIN(85, 0), - UNIPHIER_PINCTRL_PIN(88, 0), - UNIPHIER_PINCTRL_PIN(156, 0), -}; - static const unsigned emmc_pins[] = {21, 22, 23, 24, 25, 26, 27}; static const int emmc_muxvals[] = {0, 1, 1, 1, 1, 1, 1}; static const unsigned emmc_dat8_pins[] = {28, 29, 30, 31}; @@ -132,8 +118,6 @@ static const char * const uniphier_ld4_functions[] = { }; static struct uniphier_pinctrl_socdata uniphier_ld4_pinctrl_socdata = { - .pins = uniphier_ld4_pins, - .pins_count = ARRAY_SIZE(uniphier_ld4_pins), .groups = uniphier_ld4_groups, .groups_count = ARRAY_SIZE(uniphier_ld4_groups), .functions = uniphier_ld4_functions, diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c index df5f2d8..0695e07 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c @@ -11,9 +11,6 @@ #include "pinctrl-uniphier.h" -static const struct uniphier_pinctrl_pin uniphier_pro4_pins[] = { -}; - static const unsigned emmc_pins[] = {40, 41, 42, 43, 51, 52, 53}; static const int emmc_muxvals[] = {1, 1, 1, 1, 1, 1, 1}; static const unsigned emmc_dat8_pins[] = {44, 45, 46, 47}; @@ -151,8 +148,6 @@ static const char * const uniphier_pro4_functions[] = { }; static struct uniphier_pinctrl_socdata uniphier_pro4_pinctrl_socdata = { - .pins = uniphier_pro4_pins, - .pins_count = ARRAY_SIZE(uniphier_pro4_pins), .groups = uniphier_pro4_groups, .groups_count = ARRAY_SIZE(uniphier_pro4_groups), .functions = uniphier_pro4_functions, diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c index 7b14662..39cdd95 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c @@ -11,19 +11,6 @@ #include "pinctrl-uniphier.h" -static const struct uniphier_pinctrl_pin uniphier_pro5_pins[] = { - UNIPHIER_PINCTRL_PIN(47, 0), - UNIPHIER_PINCTRL_PIN(48, 0), - UNIPHIER_PINCTRL_PIN(49, 0), - UNIPHIER_PINCTRL_PIN(50, 0), - UNIPHIER_PINCTRL_PIN(53, 0), - UNIPHIER_PINCTRL_PIN(54, 0), - UNIPHIER_PINCTRL_PIN(87, 0), - UNIPHIER_PINCTRL_PIN(88, 0), - UNIPHIER_PINCTRL_PIN(101, 0), - UNIPHIER_PINCTRL_PIN(102, 0), -}; - static const unsigned emmc_pins[] = {36, 37, 38, 39, 40, 41, 42}; static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0}; static const unsigned emmc_dat8_pins[] = {43, 44, 45, 46}; @@ -142,8 +129,6 @@ static const char * const uniphier_pro5_functions[] = { }; static struct uniphier_pinctrl_socdata uniphier_pro5_pinctrl_socdata = { - .pins = uniphier_pro5_pins, - .pins_count = ARRAY_SIZE(uniphier_pro5_pins), .groups = uniphier_pro5_groups, .groups_count = ARRAY_SIZE(uniphier_pro5_groups), .functions = uniphier_pro5_functions, diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c index 90d6329..70c985d 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c @@ -11,13 +11,6 @@ #include "pinctrl-uniphier.h" -static const struct uniphier_pinctrl_pin uniphier_pxs2_pins[] = { - UNIPHIER_PINCTRL_PIN(113, 0), - UNIPHIER_PINCTRL_PIN(114, 0), - UNIPHIER_PINCTRL_PIN(115, 0), - UNIPHIER_PINCTRL_PIN(116, 0), -}; - static const unsigned emmc_pins[] = {36, 37, 38, 39, 40, 41, 42}; static const int emmc_muxvals[] = {9, 9, 9, 9, 9, 9, 9}; static const unsigned emmc_dat8_pins[] = {43, 44, 45, 46}; @@ -135,8 +128,6 @@ static const char * const uniphier_pxs2_functions[] = { }; static struct uniphier_pinctrl_socdata uniphier_pxs2_pinctrl_socdata = { - .pins = uniphier_pxs2_pins, - .pins_count = ARRAY_SIZE(uniphier_pxs2_pins), .groups = uniphier_pxs2_groups, .groups_count = ARRAY_SIZE(uniphier_pxs2_groups), .functions = uniphier_pxs2_functions, diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c index 897ce15..5168bbe 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c @@ -11,34 +11,6 @@ #include "pinctrl-uniphier.h" -static const struct uniphier_pinctrl_pin uniphier_sld8_pins[] = { - UNIPHIER_PINCTRL_PIN(32, 8), - UNIPHIER_PINCTRL_PIN(33, 8), - UNIPHIER_PINCTRL_PIN(34, 8), - UNIPHIER_PINCTRL_PIN(35, 8), - UNIPHIER_PINCTRL_PIN(36, 8), - UNIPHIER_PINCTRL_PIN(37, 8), - UNIPHIER_PINCTRL_PIN(38, 8), - UNIPHIER_PINCTRL_PIN(39, 8), - UNIPHIER_PINCTRL_PIN(40, 9), - UNIPHIER_PINCTRL_PIN(41, 0), - UNIPHIER_PINCTRL_PIN(42, 0), - UNIPHIER_PINCTRL_PIN(43, 0), - UNIPHIER_PINCTRL_PIN(44, 0), - UNIPHIER_PINCTRL_PIN(70, 0), - UNIPHIER_PINCTRL_PIN(71, 0), - UNIPHIER_PINCTRL_PIN(102, 10), - UNIPHIER_PINCTRL_PIN(103, 10), - UNIPHIER_PINCTRL_PIN(104, 11), - UNIPHIER_PINCTRL_PIN(105, 11), - UNIPHIER_PINCTRL_PIN(108, 13), - UNIPHIER_PINCTRL_PIN(109, 13), - UNIPHIER_PINCTRL_PIN(112, 0), - UNIPHIER_PINCTRL_PIN(113, 0), - UNIPHIER_PINCTRL_PIN(114, 0), - UNIPHIER_PINCTRL_PIN(115, 0), -}; - static const unsigned emmc_pins[] = {21, 22, 23, 24, 25, 26, 27}; static const int emmc_muxvals[] = {1, 1, 1, 1, 1, 1, 1}; static const unsigned emmc_dat8_pins[] = {28, 29, 30, 31}; @@ -143,8 +115,6 @@ static const char * const uniphier_sld8_functions[] = { }; static struct uniphier_pinctrl_socdata uniphier_sld8_pinctrl_socdata = { - .pins = uniphier_sld8_pins, - .pins_count = ARRAY_SIZE(uniphier_sld8_pins), .groups = uniphier_sld8_groups, .groups_count = ARRAY_SIZE(uniphier_sld8_groups), .functions = uniphier_sld8_functions,