From patchwork Sat May 5 10:53:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135072 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1087250lji; Sat, 5 May 2018 03:55:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqpTqVwo+kggyk2FwIlNLN7T/wEUUpDB/qA0HX5NZMwIFo+hBuyiTkkeFQ28weNBtCyZ8Qw X-Received: by 2002:a50:9fc1:: with SMTP id c59-v6mr39952126edf.277.1525517718205; Sat, 05 May 2018 03:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525517718; cv=none; d=google.com; s=arc-20160816; b=v4u7lBErSK7w58XkqUZq8KexHXzxlkfYf3cIVCFTYRuOBwTKjFCu1Cvm2M2Hs6ttnY 8tiLbV4A+EPEcDxsaKM6w1HJyxnXXlrawVB3vs2SkcpP8lygX6KXlIDXHm5gmg78k2h/ 3ZfdUb3otxfYNJ0CDNII2CivNa4CCdYSQIwoOy6oVmjW3gkRjaUwb5gsCejFeBJyAkgg mNdXugk/5UCFQmZxPMMdAkJJJ7JqOPNVkZijA2fAiI56x3XRGv3WcvIIEyM8kbo7FSLx rZ+y47S47fuh1B3OC45dauL736pntqFs2LRoCjR0faYKuIwi/GtYYqf+x4xpPGY8pq4Z 60dQ== 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=XxBMgYL7oc44SCqQ2jigj4Kb+iYFa1AZNdGVnf3Mwi4=; b=KpODRcd5u9QeERrop5EbFvX9sQSh4W4e3ufmz6OWTSPC2u3C3g3D53j93NAte/JK8a QADXT2+yyQ/EE2EPnBhbiAa2xXbtxzxL8rFSjUWF6Y6Uq15adjYcTtfHnBrPN3ZBdhG8 RVy4I2kec6ajRs/nHY7kRodIz/A00iUEvWLszBWbB4PcODYmoysjIgvFX6yMuttz9o5F 9GqWPkpAJMq7us7GaJ+4lEl06dSoSCY6H2WmvyyopBgujLkEku83dY89/7+pe4CvDjbB ah4jTl+k+nSyG92Vu4Xwh3ExJ9tSoyBro8Iif0MZO5MjgtUoCltEX26fILPOu55ht28r YPJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=YSrej6O/; 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 w15-v6si6371692edj.221.2018.05.05.03.55.17; Sat, 05 May 2018 03:55:18 -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=YSrej6O/; 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 9C675C21FA4; Sat, 5 May 2018 10:54:38 +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 508FBC21F4D; Sat, 5 May 2018 10:54:17 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AFB7CC21E16; Sat, 5 May 2018 10:54:15 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id AFF22C21E16 for ; Sat, 5 May 2018 10:54:14 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id w45As4Er023712; Sat, 5 May 2018 19:54:05 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w45As4Er023712 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525517645; bh=XjFdfQ5RKuTeERI0UqpSIuOOy91MHXztMVVK/FlbgSc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YSrej6O/V7VsrbFPVzXiDbvXWWGE/LWUwKi2V8NOTzJkYfFgJYYB5Bh6rLsZ+mvW4 SXcmjcv+xGMkzTIGoKh/uni3Ya7haJvpBZnPfBRrFXcxCCxnhUX6+WXGwI3lD+lVWr rOqYPrQeyQJnOzNTCcYQwIpE3uDOuVKUkqG3/pDLzw0i69w8KvWkEjSW0Odk97MoRd PedftnPUofAPACWXs7MiLSlMzyjQMtJuF9ByYaokTzBldk0HJkqdfcIWxYMUnDLWVV kcjXSYS2UYNIMc0wUER+ItWZafcXwx6YdzxY42bFMmYw6jZ9FGvXRy8w47fHdTBpM8 pmynYRC5IaSJQ== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 5 May 2018 19:53:51 +0900 Message-Id: <1525517637-17603-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> References: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 1/7] pinctrl: uniphier: remove unneeded pin data of LD6b 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" Since commit f73cfb4d0dee ("pinctrl: uniphier: simplify input enable and delete pin arrays"), these data are no longer used in any useful way. Remove. Signed-off-by: Masahiro Yamada --- drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c index 6ade131..ed702c6 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c @@ -11,17 +11,6 @@ #include "pinctrl-uniphier.h" -static const struct uniphier_pinctrl_pin uniphier_ld6b_pins[] = { - UNIPHIER_PINCTRL_PIN(113, 0), - UNIPHIER_PINCTRL_PIN(114, 0), - UNIPHIER_PINCTRL_PIN(115, 0), - UNIPHIER_PINCTRL_PIN(116, 0), - UNIPHIER_PINCTRL_PIN(217, 0), - UNIPHIER_PINCTRL_PIN(218, 0), - UNIPHIER_PINCTRL_PIN(219, 0), - UNIPHIER_PINCTRL_PIN(220, 0), -}; - static const unsigned emmc_pins[] = {36, 37, 38, 39, 40, 41, 42}; static const int emmc_muxvals[] = {1, 1, 1, 1, 1, 1, 1}; static const unsigned emmc_dat8_pins[] = {43, 44, 45, 46}; @@ -135,8 +124,6 @@ static const char * const uniphier_ld6b_functions[] = { }; static struct uniphier_pinctrl_socdata uniphier_ld6b_pinctrl_socdata = { - .pins = uniphier_ld6b_pins, - .pins_count = ARRAY_SIZE(uniphier_ld6b_pins), .groups = uniphier_ld6b_groups, .groups_count = ARRAY_SIZE(uniphier_ld6b_groups), .functions = uniphier_ld6b_functions, From patchwork Sat May 5 10:53:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135078 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1089720lji; Sat, 5 May 2018 03:59:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq8xjOkZXec37EGA4oAQJfshXdRx4lCcx0N2qmQjSKumBg7st2nEelRGrVLGXOuovZxi/PS X-Received: by 2002:a50:a4f6:: with SMTP id x51-v6mr40160245edb.247.1525517948852; Sat, 05 May 2018 03:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525517948; cv=none; d=google.com; s=arc-20160816; b=qLV/rRTG0uvXhyZS6g2UZ28QXujPrn/YX3DC5NU9mR/JicCQfI3d49yP58cd7NPpzz G6zWqkoIzSzjjg3kfgmeCegsyzZeNl1Ydt5e/ixB22pLBqS9mROzXR0uNBtUq/SMwX9c QWXeOF1Rubmh3US0dLuhfbPaOWjfNd/lt47qaR6IZBraZuMcpcw4RMqjrDWw/eu43hQH GvbVbQ//IZ1YT1PBpFhlhN0RopNkpluj46qM/Skb8wggHsjpSeDxODhLVlC9mHAFq0GL JH5Qpl1jL97RRvtPhzzUgZduTJPHcLt1xILasyeAkFLIkB5u9YnLSod6UNu5MsF2AiPe /eyQ== 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=mGMYuzp6LThkenQEpEQEVAhDHFC6DBxCq0cDtthAwF8=; b=bTwTyFql1lPznqs/+P3C9Z9yistG1IUWX1klmBXi1p/Tm0HE+63JGiUij9++POkZB/ SbE/RKoJggLVyxFUlgg8e/mhWWzyTjBUnY+dDcEMCgpBakOllTcR+w3aeZmpUdUpUzby YKx6WCp2i7mPIIe4ZT5zeotQkVAjz1jQnXMZ0KoKVGjjRNi49SHHM+t/yH4XjzwSUQsF to97pnYmW2xKfiS6tFftTTUb7nEiyuzaDRILlyExirVINDm6U1T5WOXf5JyYepraeADK CkrLOorODMUMs5GT4zmkxqNpI6/sgZ1MKGyuMlbSepBY3iAIZ5KZ2Pr0GvKp5IJHQF2p dvUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=cF17IFtT; 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 y5-v6si3031106edd.61.2018.05.05.03.59.08; Sat, 05 May 2018 03:59:08 -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=cF17IFtT; 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 74019C21F9E; Sat, 5 May 2018 10:55:49 +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 0A30CC21FC4; Sat, 5 May 2018 10:54:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 32AF2C21E85; Sat, 5 May 2018 10:54:15 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id DD429C21F49 for ; Sat, 5 May 2018 10:54:14 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id w45As4Es023712; Sat, 5 May 2018 19:54:05 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w45As4Es023712 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525517645; bh=HUo0Evd5t8v/kUGjFeRCFiurrDe/4lD8hC9l4bS/qgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cF17IFtTWigERS+nQ4czLLc7+rHndxZDcKSd4XNrdjyyhIj0E76BU+FL0uuXDO7RG eCSpqo/KilkMXs6uhehue95oYF3BFB853olbTEW00cJhFxmrW8KBkVb0+kNdGLflHc 3qZ/M4PjDOyOytm5l31o+30E6eA9iivyuB4HZX9oJLRgFMU2x8Ed65uVV1nmweC8mj hZZNVrl9V+pmZRuaJu/gqLi/guSUvpqd9lGpKZ12XOouXwG9FRuKNSTPnv82nPgD8r ZFYoX6BwUXrdNBvMhLRBROfZRaMK9fzTviFzNtPqDs9Mi17K5cEAtVYv94wzL2mZOL mDDt319aGuZoQ== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 5 May 2018 19:53:52 +0900 Message-Id: <1525517637-17603-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> References: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 2/7] pinctrl: uniphier: replace printf() with dev_err() 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" dev_err() is more suitable for printing error messages. Signed-off-by: Masahiro Yamada --- drivers/pinctrl/uniphier/pinctrl-uniphier-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c index 215b19e..ac6c82d 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c @@ -174,7 +174,7 @@ static int uniphier_pinconf_set_one(struct udevice *dev, unsigned int pin, ret = uniphier_pinconf_input_enable(dev, pin, arg); break; default: - printf("unsupported configuration parameter %u\n", param); + dev_err(dev, "unsupported configuration parameter %u\n", param); return -EINVAL; } From patchwork Sat May 5 10:53:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135073 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1088364lji; Sat, 5 May 2018 03:56:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo076OQ/20v4wrMXVTIDUZ4urwisyyI/5sZjmJEucA4nC5TaVIXvaRuIq3WNE/fFTcAu3h7 X-Received: by 2002:a50:92a6:: with SMTP id k35-v6mr40646588eda.110.1525517819830; Sat, 05 May 2018 03:56:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525517819; cv=none; d=google.com; s=arc-20160816; b=kZ6cg4gxIhZfeLdEQUPGDmgwFLNyFX1nQFy2zx8Jl0UlxMQvrzjcpBMh+rUgo0Jz7F MFM+s1s62gTEjtbGIjWkQCtEvOJGrP8OkiZZnP1HGuID1aF8CrdoE8Q2nvAmBDfIabVn 9mmQXEuPTCMvbO4puFDBp5AzqbyWaf9ZZsv/mPB0e9WsXrQy0BBgvLXL2KWYctjw3orY ptxUAnm8zktLX8b+wGKPmN3P7q/sdP6EotDvtZ5/Gifc8nWJVltS1v8uegZ92svR1Uwc 6Jbbmi2HaAGDKCXVwvMNNGLBBR+iKdndJVnAxGqsx1W666SHjXonOSdWNRqeog6u/Ntm znNA== 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=U01jm8RgYLpnJcPyMuQcOwlEZpg9Mh2m46sbm7V3zE4=; b=QbsvwvOSHxcKS1yqb0RuOtt9O5Ln9JXouWsDny0SMxuTkToRcn+zXmr0AS4p2SAtCx 9LnKiqRECpf32bOIkk8aCV9Sch+I8BFo971hceCX9L3VrwTs6HF0g3rpz4EfgqWSmwlo PVn96Quzu2vsICU4RCWxpJ9nisgPYCAGLtuuBZN56wK7nxvBPkrCY9f1Y92QzdjI1qlA d1+m987YNSStS+CpVIvHjVanbW6kjyWQef80PrSGBTgUxWeYQNyeMAApDZlaIrEulE1r VgMj35vXYS00aKfDW2xEFl9GHGVzsDZX6W2jHHC2UFDCFG0whW7Rzb+/aXDz9LF64g0Y 946g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=dakMIJGC; 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 s41-v6si480005edb.446.2018.05.05.03.56.59; Sat, 05 May 2018 03:56:59 -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=dakMIJGC; 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 7BAC2C21FB5; Sat, 5 May 2018 10:55:12 +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 F0B82C21FB2; Sat, 5 May 2018 10:54:18 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F11F4C21E16; Sat, 5 May 2018 10:54:15 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id E15F5C21F74 for ; Sat, 5 May 2018 10:54:14 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id w45As4Et023712; Sat, 5 May 2018 19:54:06 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w45As4Et023712 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525517646; bh=OCLIrhE6Yag8LECVfLyj7lmiYs4f2Zsr9XwCmtGOlys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dakMIJGCBVLl9aPcmzPs0KQRt7GD99RsP/w3z7h2gj8Y/evBjnF9eqa1H0lBJW/7D LOj1vTpQ+rJ2BTYpaGW9NM2umGfGfb4gt073j7cTL4+EUeIO9gZjI1ugINoJhsGHKR FZkwNZQYBGXQS67ZBW85SfKLsCj0gzOzO3oP+8yD1s5RCGp3sIoTZFBQrA+OivgxFP q/T3JiBWjSjH7XYtRllEa0oUUPTGED9QeCfARKN6fzDiAUshNDQA40z+0ZGYylSJLf 9/qZBWtbqVacY184poNCmNaPlTor6T2EJ7M27fQ32UWWI5xvcHVNDwh5g6Wr/uQEaB jKHGrd+6ojPaA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 5 May 2018 19:53:53 +0900 Message-Id: <1525517637-17603-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> References: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 3/7] pinctrl: uniphier: include instead of 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 #include is here to use BUILD_BUG_ON_ZERO(). By replacing it with , we can reduce the number of headers pulled in. Signed-off-by: Masahiro Yamada --- drivers/pinctrl/uniphier/pinctrl-uniphier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier.h b/drivers/pinctrl/uniphier/pinctrl-uniphier.h index a0eccf8..40e5ad7 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier.h +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier.h @@ -9,7 +9,7 @@ #define __PINCTRL_UNIPHIER_H__ #include -#include +#include #include #include From patchwork Sat May 5 10:53:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135075 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1089190lji; Sat, 5 May 2018 03:58:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqRXkX6a86PSy5TVAOLs8OdAJyKWoqRAK2wjNhATijEYU7mjTZDUfZdy/d49S9oQZswXMFQ X-Received: by 2002:a50:a845:: with SMTP id j63-v6mr40720927edc.210.1525517900415; Sat, 05 May 2018 03:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525517900; cv=none; d=google.com; s=arc-20160816; b=f9UpTh6fWx9ZdP4esqFLh4p+/ff+zPM5Y3TZMTVSNQD1PHlEfmvlXwGLlOTD/SRae/ 07/7Ju7la0C1+1kk3KBu99plDGU5To52mWQVbC9szQHjCgrkmZe+3EfKVZpXH86RNz4u /iMnFD6GmRN9pZxDEBO06hF5NkNFkztO4gLOBZ1AXF27hx2FlKbnCDJnwzCHY374rW9h M5zn8ydgTI1Ak4fH/JSVkjDw4BjLfYPGjrYNtYBWfNuKzYnO8emn7j6+f8mE1sIH7hjN SUZIKclaQdz/whitz6liTfCDoTKB4aBqi3rzSixsTe5e57HTTK+gqAinMNxmlU2fOJ8b gJtw== 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=AdKS3sRGvrkyB9btTejZWGZmjuIwGJCP2JZIOfNouA0=; b=ISB2ZmoxdTBj9spLeW85YAzp7Pw0qF3HlgPXcL3B35N6z3NOB2/GClZpQ4lB5KkykB Hc/jP2TwCNnTAxOz5cGO4Ny3NEj8BX9Y1VIodXgSE5TVAnW8iFdlLeHA9dNxZl6ZEXb1 2Sf6ORiqySdxietM2Zxg9ilRnPWfgPcadwtdn4Kkg0w80T+ALTnmwUdFveJ26amoqs/Q Ic5hR65jkDc5Z2mGYMGHivXffVTps56qRjrAzfREuCXFpgdp2IFSYsHll6gfyoLndgw9 xluiu1i4oe3rJjjo/B+4NG5qYEB0kPCCVfiX+TfFw0K20Jpj8giNUczlUSu+qasdEG0B xQRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=PO1palut; 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 y100-v6si3868684ede.117.2018.05.05.03.58.20; Sat, 05 May 2018 03:58:20 -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=PO1palut; 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 0E8BEC21FD8; Sat, 5 May 2018 10:56:04 +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 BCEECC21FCB; Sat, 5 May 2018 10:54:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 431B7C21E16; Sat, 5 May 2018 10:54:15 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id DDA1DC21F4D for ; Sat, 5 May 2018 10:54:14 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id w45As4Eu023712; Sat, 5 May 2018 19:54:06 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w45As4Eu023712 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525517646; bh=ZxZbReuO/4I/XgBr/ULrvf25FBaZj4RreE18anifxS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PO1palutpoRw3zyVvk8gO2cvR/MGuv1Hc1Zd4SZ4uOi/2419+pKCmXAd/VUgD/ERp IYtoNC6u9cNLXTgY5EWaRCY8E7n51KIzthD5VaJjlWRaogUm519EnZVUoc38RLpMue Xe67YGAWKnWgBlIuvnMbzBadD8sLCGUML5DrVTR3gRgFYPHxmnIjEVXsdcVj89dbGD /WubrJ2lWg5pF4NQsCaCyoGOWQcqwvzYrMXyEaAjn1y04THMykdDz3kXAfdCxPLu+B HGCkLfB2ZkF38XxbagTzIInxaCy/kffZszYkJisG2C5FjGB35Y9CrCRIZ3QMCISqVb 0e3putbeU3SQg== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 5 May 2018 19:53:54 +0900 Message-Id: <1525517637-17603-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> References: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 4/7] pinctrl: uniphier: support per-pin configuration via DT 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" Currently, the UniPhier pinctrl drivers expose only the pin-group interface to device tree. Provide .get_pins_count, .get_pin_name, .pinconf_set hooks to support pin configuration via 'pins' DT property. Signed-off-by: Masahiro Yamada --- drivers/pinctrl/uniphier/pinctrl-uniphier-core.c | 37 ++++++++++++++++++++++-- drivers/pinctrl/uniphier/pinctrl-uniphier.h | 3 +- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c index ac6c82d..03103b3 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c @@ -22,6 +22,34 @@ static const char *uniphier_pinctrl_dummy_name = "_dummy"; +static int uniphier_pinctrl_get_pins_count(struct udevice *dev) +{ + struct uniphier_pinctrl_priv *priv = dev_get_priv(dev); + const struct uniphier_pinctrl_pin *pins = priv->socdata->pins; + int pins_count = priv->socdata->pins_count; + + /* + * We do not list all pins in the pin table to save memory footprint. + * Report the max pin number + 1 to fake the framework. + */ + return pins[pins_count - 1].number + 1; +} + +static const char *uniphier_pinctrl_get_pin_name(struct udevice *dev, + unsigned int selector) +{ + struct uniphier_pinctrl_priv *priv = dev_get_priv(dev); + const struct uniphier_pinctrl_pin *pins = priv->socdata->pins; + int pins_count = priv->socdata->pins_count; + int i; + + for (i = 0; i < pins_count; i++) + if (pins[i].number == selector) + return pins[i].name; + + return uniphier_pinctrl_dummy_name; +} + static int uniphier_pinctrl_get_groups_count(struct udevice *dev) { struct uniphier_pinctrl_priv *priv = dev_get_priv(dev); @@ -158,8 +186,8 @@ static int uniphier_pinconf_bias_set(struct udevice *dev, unsigned int pin, return 0; } -static int uniphier_pinconf_set_one(struct udevice *dev, unsigned int pin, - unsigned int param, unsigned int arg) +static int uniphier_pinconf_set(struct udevice *dev, unsigned int pin, + unsigned int param, unsigned int arg) { int ret; @@ -191,7 +219,7 @@ static int uniphier_pinconf_group_set(struct udevice *dev, int i, ret; for (i = 0; i < grp->num_pins; i++) { - ret = uniphier_pinconf_set_one(dev, grp->pins[i], param, arg); + ret = uniphier_pinconf_set(dev, grp->pins[i], param, arg); if (ret) return ret; } @@ -269,6 +297,8 @@ static int uniphier_pinmux_group_set(struct udevice *dev, } const struct pinctrl_ops uniphier_pinctrl_ops = { + .get_pins_count = uniphier_pinctrl_get_pins_count, + .get_pin_name = uniphier_pinctrl_get_pin_name, .get_groups_count = uniphier_pinctrl_get_groups_count, .get_group_name = uniphier_pinctrl_get_group_name, .get_functions_count = uniphier_pinmux_get_functions_count, @@ -277,6 +307,7 @@ const struct pinctrl_ops uniphier_pinctrl_ops = { #if CONFIG_IS_ENABLED(PINCONF) .pinconf_num_params = ARRAY_SIZE(uniphier_pinconf_params), .pinconf_params = uniphier_pinconf_params, + .pinconf_set = uniphier_pinconf_set, .pinconf_group_set = uniphier_pinconf_group_set, #endif .set_state = pinctrl_generic_set_state, diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier.h b/drivers/pinctrl/uniphier/pinctrl-uniphier.h index 40e5ad7..8884b08 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier.h +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier.h @@ -28,7 +28,8 @@ static inline unsigned int uniphier_pin_get_iectrl(unsigned long data) */ struct uniphier_pinctrl_pin { unsigned number; - unsigned long data; + const char *name; + unsigned int data; }; /** From patchwork Sat May 5 10:53:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135077 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1089455lji; Sat, 5 May 2018 03:58:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoQmXuHuWFHYEubGsqVcdIajkzVwnFfSrWn35CfHSyOBeQG8bSCIj9nc+prZJCl/7FEwcHx X-Received: by 2002:a50:fc0c:: with SMTP id i12-v6mr40093519edr.74.1525517926132; Sat, 05 May 2018 03:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525517926; cv=none; d=google.com; s=arc-20160816; b=nBI7PMZeiH8AJuWtE+xA7d3/2d0PaLdiGp5MOMxA+XHcps3jg11FYmmDyaJf4X1ol7 hOgyJee5lcXx3QfyzFRz6VdPI/BQzR/ORpua8lwG0SKdbDCIfpUkSux0OsfP1vcP7fzW TWqZntdWi/6mm62hH7JQW9OofTEudSFiWFmTHSojEEbV4XzXAqEJaP3bZGbDEewBcPIQ 6ERgidYMWVB5RSs6W1LPkr1vzyscg+64xIOST8xy95iazhQmz3x8i4gIGudVlp9aIATv uEZmAbtXGb1mAz9vp/memxMyxa5gcnCoeN610NptSBfPfoJUBoMQfc+OfiImXHbWbe21 tiOA== 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=6jiutLslzaglAGv8Is2kkqbUVGzyF0OaeY4UM/qdWyg=; b=RdeTcjufmv2t54PyUxAE78SnQG5edCRtwa3s+KBlfXkRmYnt7ncJD//RFoJgCoIgFK ibvEradyL7325TSPpua37SXE6fi9dYJdOTuq0ZsYaDt/fTaZTRDMgYQLbGrYumI0Tlit zSUu6JP6S2eCYBHLKbFoOd+XccJMSDEORo8zlF4prBeZo0yB8IiNQiQJ7Jnem2fL+ERh mmHbyxDyzi4bf7sPqkxQ6BM4krC1eMQ6W7mF4ADucOSRDB5eyi3IHRRvxejRJnVPOiWH //1dI1McbVLt93TIreCTb6z0Liv4V/wz79t9uPMzHA0P/ePBrbAf1iGICvUbrZHfpCP+ wmLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=bK/9pt1u; 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 x40-v6si641852edx.299.2018.05.05.03.58.45; Sat, 05 May 2018 03:58:46 -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=bK/9pt1u; 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 B304AC21FC7; Sat, 5 May 2018 10:55:29 +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 19FD3C21FB1; Sat, 5 May 2018 10:54:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1CCB3C21F1C; Sat, 5 May 2018 10:54:15 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id DB348C21F41 for ; Sat, 5 May 2018 10:54:14 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id w45As4Ev023712; Sat, 5 May 2018 19:54:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w45As4Ev023712 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525517647; bh=trk+Er6bVJ+Q4WpXnw0gToksizvrhXEYSUX/iXtnv0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bK/9pt1u07UG1BYTevyRtg09yF0iR3e4luVfDGb8xh1aWI8J3vZrr9upPNc/YQd9D +/TEpUFNx+bvoILdk1Sf3IBVXzVEjlSMJogjuQY28lCQMEq1xa3wSuAP3sWJiNwAvZ YyMrNX65B83RsL+fyA1xSi69xH06FEDSIPZwNdQ7kb4iaXAF1q7ZQTqJm7omjkaDcB MTHcdr3OvGpaievO2JvtXIGjE2t7KlQBklNfDtamDJ47u1pH45IxQW7b8YKlcGrPcD xEdA/APFcI/HcXHVCgSgv02aC93Q9NnyEiRMuOsmpuoMawAjtWSDXRR2eELXvqHGtF 0Cm9E2Kf5FTUw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 5 May 2018 19:53:55 +0900 Message-Id: <1525517637-17603-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> References: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 5/7] pinctrl: uniphier: support drive-strength configuration 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" This allows our DT to specify drive-strength property. Signed-off-by: Masahiro Yamada --- drivers/pinctrl/uniphier/pinctrl-uniphier-core.c | 101 +++++++++++++++++++++++ drivers/pinctrl/uniphier/pinctrl-uniphier.h | 44 ++++++++-- 2 files changed, 140 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c index 03103b3..39b5366 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c @@ -17,6 +17,9 @@ #define UNIPHIER_PINCTRL_PINMUX_BASE 0x1000 #define UNIPHIER_PINCTRL_LOAD_PINMUX 0x1700 +#define UNIPHIER_PINCTRL_DRVCTRL_BASE 0x1800 +#define UNIPHIER_PINCTRL_DRV2CTRL_BASE 0x1900 +#define UNIPHIER_PINCTRL_DRV3CTRL_BASE 0x1980 #define UNIPHIER_PINCTRL_PUPDCTRL_BASE 0x1a00 #define UNIPHIER_PINCTRL_IECTRL 0x1d00 @@ -142,10 +145,25 @@ static const struct pinconf_param uniphier_pinconf_params[] = { { "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, 1 }, { "bias-pull-down", PIN_CONFIG_BIAS_PULL_DOWN, 1 }, { "bias-pull-pin-default", PIN_CONFIG_BIAS_PULL_PIN_DEFAULT, 1 }, + { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 0 }, { "input-enable", PIN_CONFIG_INPUT_ENABLE, 1 }, { "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 }, }; +static const struct uniphier_pinctrl_pin * +uniphier_pinctrl_pin_get(struct uniphier_pinctrl_priv *priv, unsigned int pin) +{ + const struct uniphier_pinctrl_pin *pins = priv->socdata->pins; + int pins_count = priv->socdata->pins_count; + int i; + + for (i = 0; i < pins_count; i++) + if (pins[i].number == pin) + return &pins[i]; + + return NULL; +} + static int uniphier_pinconf_bias_set(struct udevice *dev, unsigned int pin, unsigned int param, unsigned int arg) { @@ -186,6 +204,86 @@ static int uniphier_pinconf_bias_set(struct udevice *dev, unsigned int pin, return 0; } +static const unsigned int uniphier_pinconf_drv_strengths_1bit[] = { + 4, 8, +}; + +static const unsigned int uniphier_pinconf_drv_strengths_2bit[] = { + 8, 12, 16, 20, +}; + +static const unsigned int uniphier_pinconf_drv_strengths_3bit[] = { + 4, 5, 7, 9, 11, 12, 14, 16, +}; + +static int uniphier_pinconf_drive_set(struct udevice *dev, unsigned int pin, + unsigned int strength) +{ + struct uniphier_pinctrl_priv *priv = dev_get_priv(dev); + const struct uniphier_pinctrl_pin *desc; + const unsigned int *strengths; + unsigned int base, stride, width, drvctrl, reg, shift; + u32 val, mask, tmp; + + desc = uniphier_pinctrl_pin_get(priv, pin); + if (WARN_ON(!desc)) + return -EINVAL; + + switch (uniphier_pin_get_drv_type(desc->data)) { + case UNIPHIER_PIN_DRV_1BIT: + strengths = uniphier_pinconf_drv_strengths_1bit; + base = UNIPHIER_PINCTRL_DRVCTRL_BASE; + stride = 1; + width = 1; + break; + case UNIPHIER_PIN_DRV_2BIT: + strengths = uniphier_pinconf_drv_strengths_2bit; + base = UNIPHIER_PINCTRL_DRV2CTRL_BASE; + stride = 2; + width = 2; + break; + case UNIPHIER_PIN_DRV_3BIT: + strengths = uniphier_pinconf_drv_strengths_3bit; + base = UNIPHIER_PINCTRL_DRV3CTRL_BASE; + stride = 4; + width = 3; + break; + default: + /* drive strength control is not supported for this pin */ + return -EINVAL; + } + + drvctrl = uniphier_pin_get_drvctrl(desc->data); + drvctrl *= stride; + + reg = base + drvctrl / 32 * 4; + shift = drvctrl % 32; + mask = (1U << width) - 1; + + for (val = 0; val <= mask; val++) { + if (strengths[val] > strength) + break; + } + + if (val == 0) { + dev_err(dev, "unsupported drive strength %u mA for pin %s\n", + strength, desc->name); + return -EINVAL; + } + + if (!mask) + return 0; + + val--; + + tmp = readl(priv->base + reg); + tmp &= ~(mask << shift); + tmp |= (mask & val) << shift; + writel(tmp, priv->base + reg); + + return 0; +} + static int uniphier_pinconf_set(struct udevice *dev, unsigned int pin, unsigned int param, unsigned int arg) { @@ -198,6 +296,9 @@ static int uniphier_pinconf_set(struct udevice *dev, unsigned int pin, case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: ret = uniphier_pinconf_bias_set(dev, pin, param, arg); break; + case PIN_CONFIG_DRIVE_STRENGTH: + ret = uniphier_pinconf_drive_set(dev, pin, arg); + break; case PIN_CONFIG_INPUT_ENABLE: ret = uniphier_pinconf_input_enable(dev, pin, arg); break; diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier.h b/drivers/pinctrl/uniphier/pinctrl-uniphier.h index 8884b08..3f47693 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier.h +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier.h @@ -13,11 +13,44 @@ #include #include -#define UNIPHIER_PIN_ATTR_PACKED(iectrl) (iectrl) +/* drive strength control register number */ +#define UNIPHIER_PIN_DRVCTRL_SHIFT 0 +#define UNIPHIER_PIN_DRVCTRL_BITS 9 +#define UNIPHIER_PIN_DRVCTRL_MASK ((1U << (UNIPHIER_PIN_DRVCTRL_BITS)) \ + - 1) + +/* drive control type */ +#define UNIPHIER_PIN_DRV_TYPE_SHIFT ((UNIPHIER_PIN_DRVCTRL_SHIFT) + \ + (UNIPHIER_PIN_DRVCTRL_BITS)) +#define UNIPHIER_PIN_DRV_TYPE_BITS 2 +#define UNIPHIER_PIN_DRV_TYPE_MASK ((1U << (UNIPHIER_PIN_DRV_TYPE_BITS)) \ + - 1) + +/* drive control type */ +enum uniphier_pin_drv_type { + UNIPHIER_PIN_DRV_1BIT, /* 2 level control: 4/8 mA */ + UNIPHIER_PIN_DRV_2BIT, /* 4 level control: 8/12/16/20 mA */ + UNIPHIER_PIN_DRV_3BIT, /* 8 level control: 4/5/7/9/11/12/14/16 mA */ +}; + +#define UNIPHIER_PIN_DRVCTRL(x) \ + (((x) & (UNIPHIER_PIN_DRVCTRL_MASK)) << (UNIPHIER_PIN_DRVCTRL_SHIFT)) +#define UNIPHIER_PIN_DRV_TYPE(x) \ + (((x) & (UNIPHIER_PIN_DRV_TYPE_MASK)) << (UNIPHIER_PIN_DRV_TYPE_SHIFT)) + +#define UNIPHIER_PIN_ATTR_PACKED(drvctrl, drv_type) \ + UNIPHIER_PIN_DRVCTRL(drvctrl) | \ + UNIPHIER_PIN_DRV_TYPE(drv_type) + +static inline unsigned int uniphier_pin_get_drvctrl(unsigned int data) +{ + return (data >> UNIPHIER_PIN_DRVCTRL_SHIFT) & UNIPHIER_PIN_DRVCTRL_MASK; +} -static inline unsigned int uniphier_pin_get_iectrl(unsigned long data) +static inline unsigned int uniphier_pin_get_drv_type(unsigned int data) { - return data; + return (data >> UNIPHIER_PIN_DRV_TYPE_SHIFT) & + UNIPHIER_PIN_DRV_TYPE_MASK; } /** @@ -74,10 +107,11 @@ struct uniphier_pinctrl_socdata { #define UNIPHIER_PINCTRL_CAPS_MUX_4BIT BIT(0) }; -#define UNIPHIER_PINCTRL_PIN(a, b) \ +#define UNIPHIER_PINCTRL_PIN(a, b, c, d) \ { \ .number = a, \ - .data = UNIPHIER_PIN_ATTR_PACKED(b), \ + .name = b, \ + .data = UNIPHIER_PIN_ATTR_PACKED(c, d), \ } #define __UNIPHIER_PINCTRL_GROUP(grp) \ From patchwork Sat May 5 10:53:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135071 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1086688lji; Sat, 5 May 2018 03:54:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoTXgOrDL1Q1ohBWHtsyLZeWEvvfGFQ7XsW9dNk5XKGZ6t9MF4k/M1DvfDmiCFj3l0OxZIi X-Received: by 2002:a50:b4e1:: with SMTP id x30-v6mr40352269edd.155.1525517663690; Sat, 05 May 2018 03:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525517663; cv=none; d=google.com; s=arc-20160816; b=t9cyfGQbYBk7tT6O5qUI01nEwh16mcORvbUKudIu6qn152uCKMfY0oPe+i0BD7IInj Kjp7PBKrMXtwg+vkSQkXy2cWKGmkBK9J8JgbJOWvHU+ZC3MRsLzpEVP5jtENU3ndCmzM gtNPHG6mghvFL/TuYzKuisKmuCPfYIhorIf9Y3BsXxEbsOO3KgHIWzDCEzGva4hkEssC +h7RspQ3RBDYpHdamV7UMZXscxPj8BFlJo5Iw7FNkZ2MltV+DepNpqbJORxQUnIX+JTO NVEGKr5t5824coYXjW84MTuHE4Qf+ZRpRrdANRL7W58bn+gOAhTHVRxDXtGQ6mTvXTdv zdSQ== 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=/g4oC+vps1McPW6HLh2G26MSqJqUfCRoP0G1NUK0Qv4=; b=QNt/hbLkKj34R4TD4umfTGRqWpcKVKF0wmAkKztUt3TZ74wBK8O90qzlMpSPAmSNHW mHprlfgs77JOQ19kU7UVpgK47FStS8uQi7WhWoYrcO6kJcNJYL2ukxyoqL5Ki8Z4OBAs PX9xmrvI1Ycxbl384U8uW+Q/QuLwJAtUf65L0WRIdZ6ZHRlkwX6idSL9ba8kYRVeeHFN nhscxlrihMhrNodBtDmYuWh45vKBY86v/EdFIgrgQybolUiHxjcxpepVJC9Cp0Q5j8gX YnGhz5sNnEaPo0ypR7va5W6cD4VskRrGgeqSODiPv5DSIWTKvx3s72vUsRt0tAj6VjO2 N/iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=1Vnci31W; 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 f16-v6si2252559edf.188.2018.05.05.03.54.23; Sat, 05 May 2018 03:54:23 -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=1Vnci31W; 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 D2368C21FDC; Sat, 5 May 2018 10:54:18 +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 8B1D9C21E85; Sat, 5 May 2018 10:54:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A573BC21F78; Sat, 5 May 2018 10:54:15 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id BB9F4C21E85 for ; Sat, 5 May 2018 10:54:14 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id w45As4Ew023712; Sat, 5 May 2018 19:54:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w45As4Ew023712 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525517647; bh=g1uOmp2fQEomRAnQ1Sel6waH0KF9p+yFWPm8GZaV2Po=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Vnci31WrOdIjjIIPiyIUc4hr84p/5+BRuljn1au1x68aiaf4WDx+yOVHhX0/mgoD LOFSxTtJJ4uTgyebi+xEdAkJZ6HcITses/TgCRzfRinZyMw/0iOYudUZh3Ei6LYjfY dMM+Y3VHDdfnltktPogxk9JxMgMxPWbv2KWYHsNEXMoOHkegdfsceYYywGqAJPJ9na fAyU6KdvBftpCFsvsSlkn5bpce4zY6CbG/CUeR9caSgFYNgguopMNJoWMZzHr6etK4 nseqMrsF9UnjrVi/XB/D2YpXX2aWLD0S+csmZnrBlfsUhFYmFHefVyHUVP5Knt0J8+ Ey+jPwMqs+AYw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 5 May 2018 19:53:56 +0900 Message-Id: <1525517637-17603-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> References: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 6/7] pinctrl: uniphier: add ethernet TX pin data for LD20 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" These are necessary to optimize the drive-strength of the pins. Signed-off-by: Masahiro Yamada --- drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c index 11d5d98..116d1da 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c @@ -11,6 +11,15 @@ #include "pinctrl-uniphier.h" +static const struct uniphier_pinctrl_pin uniphier_ld20_pins[] = { + UNIPHIER_PINCTRL_PIN(40, "RGMII_TXCLK", 28, UNIPHIER_PIN_DRV_3BIT), + UNIPHIER_PINCTRL_PIN(41, "RGMII_TXD0", 29, UNIPHIER_PIN_DRV_3BIT), + UNIPHIER_PINCTRL_PIN(42, "RGMII_TXD1", 30, UNIPHIER_PIN_DRV_3BIT), + UNIPHIER_PINCTRL_PIN(43, "RGMII_TXD2", 31, UNIPHIER_PIN_DRV_3BIT), + UNIPHIER_PINCTRL_PIN(44, "RGMII_TXD3", 32, UNIPHIER_PIN_DRV_3BIT), + UNIPHIER_PINCTRL_PIN(45, "RGMII_TXCTL", 33, UNIPHIER_PIN_DRV_3BIT), +}; + static const unsigned emmc_pins[] = {18, 19, 20, 21, 22, 23, 24, 25}; static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0}; static const unsigned emmc_dat8_pins[] = {26, 27, 28, 29}; @@ -103,6 +112,8 @@ static const char * const uniphier_ld20_functions[] = { }; static struct uniphier_pinctrl_socdata uniphier_ld20_pinctrl_socdata = { + .pins = uniphier_ld20_pins, + .pins_count = ARRAY_SIZE(uniphier_ld20_pins), .groups = uniphier_ld20_groups, .groups_count = ARRAY_SIZE(uniphier_ld20_groups), .functions = uniphier_ld20_functions, From patchwork Sat May 5 10:53:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 135076 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1089344lji; Sat, 5 May 2018 03:58:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp8WvSk++5BEfE81fvzIoealrDrg6IDlrBeLyLeX3+J2bZFdeakzVPo+5sJlDdSqcVlXPv9 X-Received: by 2002:a50:e2c9:: with SMTP id q9-v6mr30592012edl.253.1525517913677; Sat, 05 May 2018 03:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525517913; cv=none; d=google.com; s=arc-20160816; b=GBM/DaVZCywumRhrpqc7W5fddlhRgHfqYsUrVe3qRykjtpJwkfkwyEEzVrHG444HPg MM3+aDzlGmNMUyTniR6T3G4cxo67a0uHhrHfAEBKpGI0L4QcgoAk8Cs59MgpjjipVXvk I9mmViPUXv10w8Is0npmHqUsvcTwAlSi881GC8sE6Csas8oaXMl2zB8L2D37woehO5jK ZgAPXwX9ybIw+I2oVIOPd3u92JZKD75Qy++oVHU0M77170Y+dWZfAVNO8yzjXT3rxO1+ bTRhEm3DEdVpeFYoEJMJkFy/Q1GpMl86Yv1Mi96nfCLy7L7fHa+vhb5YltVbvGQcxoUZ jAwQ== 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=F/gVX28px2I0xrR3CG7fR2uU2P43xug9eQsi00YiQLc=; b=PnI6CfRvzlT5tYk/t8uBjIsLOIJ0D/9Xn3ivWjaralbbGTBlNBg0yqht/V5wAU1oc/ MR7PcrX/Z3KiPSNkS2PQvyKeuYfwf2h6B0aJynwp2wqphjjoefVnbuzV9GKjbDmdefmV sCcl4JWi+tlEYnsmRWTFGRWO1kft4vs+JSOds4nab4ozUMTH4QuJTd3hXqdjALA9XLR/ t3uTLqEIZ19Led/TE3cIAZbZmVUFfaKVvoau9hgDOFw/FVFpZm8dR5VhDCKes8z3gb7c czB+uHFrtlaLLn1TW2akHKexSqKm/Cj9As5f6/sTGarBPO/oZ47zdQSTjvi+IMzNQwFQ g9GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=yw+tLypC; 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 u89-v6si3449895edc.308.2018.05.05.03.58.33; Sat, 05 May 2018 03:58:33 -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=yw+tLypC; 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 55E71C21FBD; Sat, 5 May 2018 10:56:21 +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 803DAC21F9E; Sat, 5 May 2018 10:54:22 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5EC92C21F41; Sat, 5 May 2018 10:54:15 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id DE7D7C21F6A for ; Sat, 5 May 2018 10:54:14 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id w45As4Ex023712; Sat, 5 May 2018 19:54:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w45As4Ex023712 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1525517647; bh=CfAWNjZZx9MtP9TfvCC12fcaCVawfIezRCqNYqQLVIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yw+tLypCSjuPBNvATqZzzf/VyTsAvPd/fbTtNpfsAI4UwqRQhOckW8oj/ih4EV8I9 jz4HoI7Uy4S+H1P369a+fDFBVPsZluNvGKuP10e/Y0zbbj68nSZNF5pfvUqZ3JwNiK DNqkvr4kIA6A9hOSYPnlGBco1TVPm27fuzVYYan4k3Uv3W9ExzwPIjr0r7ibvh6auJ jd8rUeC8RkRKipPJhdeRDiJmPs4Fpjea4vA3vdQpupUnOKrYv/Thnk+2VNtCrwBgte 3BRMbDmgnvg+LI958k6OJ1EEDeRmmJf2em+hEso1i+KlbmvmIgqBtTYT3S/wISiuDC BLPpdjMJlxZYA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 5 May 2018 19:53:57 +0900 Message-Id: <1525517637-17603-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> References: <1525517637-17603-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 7/7] ARM: uniphier: enable CONFIG_PINCONF 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" Enable the pin configuration feature for UniPhier 64 bit SoCs. Signed-off-by: Masahiro Yamada --- configs/uniphier_v8_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/uniphier_v8_defconfig b/configs/uniphier_v8_defconfig index 45c9080..93df2f6 100644 --- a/configs/uniphier_v8_defconfig +++ b/configs/uniphier_v8_defconfig @@ -41,6 +41,7 @@ CONFIG_NAND_DENALI_DT=y CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8 CONFIG_DM_ETH=y CONFIG_SNI_AVE=y +CONFIG_PINCONF=y CONFIG_SYSRESET=y CONFIG_SYSRESET_PSCI=y CONFIG_USB=y