From patchwork Tue Jan 17 03:22:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 91598 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp307959qgi; Mon, 16 Jan 2017 19:32:58 -0800 (PST) X-Received: by 10.99.62.73 with SMTP id l70mr42723155pga.97.1484623978870; Mon, 16 Jan 2017 19:32:58 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id d27si23458756pgn.154.2017.01.16.19.32.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jan 2017 19:32:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cTKW1-0008D0-KD; Tue, 17 Jan 2017 03:32:57 +0000 Received: from mail-pg0-x22d.google.com ([2607:f8b0:400e:c05::22d]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cTKVx-0008C6-DT for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2017 03:32:55 +0000 Received: by mail-pg0-x22d.google.com with SMTP id 194so20655047pgd.2 for ; Mon, 16 Jan 2017 19:32:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=ozzb8ZMuwKSnKodd6P8cRjUsM7i6SEoRD4OVwf0wH2s=; b=jZzqx7dtS37YmmVKmBcr5W6x892HqYhgTscErLGZTXjQXIPliXECK0Wqbgeyfng79r XPpAiJ32Dzx+D3toQg3jGU0cLX42THzf424Wkb36JpZSgvdG91zTMGiFQ69UdD2EV5eJ Su/IowvGUhAbArlBACld23vsy/DqxyDbZA8sg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ozzb8ZMuwKSnKodd6P8cRjUsM7i6SEoRD4OVwf0wH2s=; b=hJwS93R8Iluh4TU1zox0y/Dw+1cvzSz6ZPSfynSotHP148VqJ/42leOjEVncQgQV4g SvwQ2Kiwq497FHR4e0hAi8YsOXAglkNywiv1BLi70OX72A6zWuYNByq+NiA7OvvfRJxw 9kDB1s9LVxXsew7KbDpoDd5KAfXgf/o/fmH9IScYs4/BCkx2jeFHE4o0tIQYON7RkjWN BTC7dMSygA6LrRP7MDWMO4gAZlmdVPlYCKqzzVJsR2mdqsrPghNkAl+2hxbUCVy0EL63 LgAiTkFc3rXf8OyGm/OD+/nO818ndeZvdFNPt+VdwJMAIaljBQddwMly7FL5J+qXus/S PuDg== X-Gm-Message-State: AIkVDXLJLnT2pccPaYb5GaYepmJvYBcnSwflv6E9yvUcK2iRvo/RyRFCQScfza0rykee6D5C X-Received: by 10.84.198.129 with SMTP id p1mr56138898pld.14.1484623951945; Mon, 16 Jan 2017 19:32:31 -0800 (PST) Received: from localhost.localdomain ([104.237.91.166]) by smtp.gmail.com with ESMTPSA id u124sm51075845pgb.6.2017.01.16.19.32.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 19:32:31 -0800 (PST) From: Baoyou Xie To: jun.nie@linaro.org, p.zabel@pengutronix.de, robh+dt@kernel.org, mark.rutland@arm.com Subject: [PATCH v3 1/3] dt: bindings: add documentation for zx2967 family reset controller Date: Tue, 17 Jan 2017 11:22:55 +0800 Message-Id: <1484623377-16208-1-git-send-email-baoyou.xie@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170116_193253_634652_6C1A9844 X-CRM114-Status: GOOD ( 11.16 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 HK_RANDOM_ENVFROM Envelope sender username looks random -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c05:0:0:0:22d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, xie.baoyou@zte.com.cn, linux-kernel@vger.kernel.org, chen.chaokai@zte.com.cn, wang.qiang01@zte.com.cn, baoyou.xie@linaro.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org This patch adds dt-binding documentation for zx2967 family reset controller. Signed-off-by: Baoyou Xie Reviewed-by: Shawn Guo --- .../devicetree/bindings/reset/zte,zx2967-reset.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Documentation/devicetree/bindings/reset/zte,zx2967-reset.txt -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/Documentation/devicetree/bindings/reset/zte,zx2967-reset.txt b/Documentation/devicetree/bindings/reset/zte,zx2967-reset.txt new file mode 100644 index 0000000..b015508 --- /dev/null +++ b/Documentation/devicetree/bindings/reset/zte,zx2967-reset.txt @@ -0,0 +1,20 @@ +ZTE zx2967 SoCs Reset Controller +======================================= + +Please also refer to reset.txt in this directory for common reset +controller binding usage. + +Required properties: +- compatible: should be one of the following. + * zte,zx296718-reset +- reg: physical base address of the controller and length of memory mapped + region. +- #reset-cells: must be 1. + +example: + + reset: reset-controller@1461060 { + compatible = "zte,zx296718-reset"; + reg = <0x01461060 0x8>; + #reset-cells = <1>; + }; From patchwork Tue Jan 17 03:22:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 91599 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp308010qgi; Mon, 16 Jan 2017 19:33:10 -0800 (PST) X-Received: by 10.84.173.168 with SMTP id p37mr51529137plb.30.1484623990750; Mon, 16 Jan 2017 19:33:10 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 123si23515176pfe.90.2017.01.16.19.33.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jan 2017 19:33:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cTKWD-0008Sa-1z; Tue, 17 Jan 2017 03:33:09 +0000 Received: from mail-pf0-x233.google.com ([2607:f8b0:400e:c00::233]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cTKW2-0008CO-FK for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2017 03:33:00 +0000 Received: by mail-pf0-x233.google.com with SMTP id f144so58182588pfa.2 for ; Mon, 16 Jan 2017 19:32:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WI+tFkrIv5GF6dvy0Vll2/+At6MFtggoqenFHX7OSP4=; b=BdB1xoXAtXC5uA2dY/JWj1AyvyR2BPArhIPgMrjCEIlajLmUxu/7EKoVk5s7/kstDu 2BBkyu1vmzOq/k2yPlf7oAgPSpH79w3gRuudzpp9QRwFY8ctRKVS+zrXBE/2S6LyEqsO fxWQPKbqKxVfU0SYR7U2gHCtUdRO2m7Qio+j8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WI+tFkrIv5GF6dvy0Vll2/+At6MFtggoqenFHX7OSP4=; b=nHlaTqJObAellsKr0PM9L5mS6xEoUSxjoQZfbKFtD0mHN0fA8cH8+9QPtIwJybuNLS BP/m8pqo9gCbkBb48oJP7k90muIjimJxRRRcQPSyRfKSETNa09bNVkr4VW4CRATfVC42 KmOhW5S41W77ru/ObrJ7sbWj+lQCD/oLZPBkQKWnqDPc4fpOTsAl79ZBn3EnrsnvG/bY J4oCBYItqL4SnA5SdZSXZBHy8VUMnK7vxD2u5FfixlCIXNawWUnqDTl1u+eT3i0gqJs5 2bH/ITuAV+M6Pi+GSkLwbB2BpCIfJqSmdqm0LkSKMlEs0zcll+RqcHuOL9PVPLChGV9e l+qA== X-Gm-Message-State: AIkVDXJZgU6M/v8Bod30C0recg0+4TOoxxfAfIXMIufkOiyF5bIpNNraraWppjL4nhIzqbAl X-Received: by 10.99.8.133 with SMTP id 127mr44402768pgi.76.1484623957436; Mon, 16 Jan 2017 19:32:37 -0800 (PST) Received: from localhost.localdomain ([104.237.91.166]) by smtp.gmail.com with ESMTPSA id u124sm51075845pgb.6.2017.01.16.19.32.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 19:32:36 -0800 (PST) From: Baoyou Xie To: jun.nie@linaro.org, p.zabel@pengutronix.de, robh+dt@kernel.org, mark.rutland@arm.com Subject: [PATCH v3 2/3] MAINTAINERS: add zx2967 reset controller driver to ARM ZTE architecture Date: Tue, 17 Jan 2017 11:22:56 +0800 Message-Id: <1484623377-16208-2-git-send-email-baoyou.xie@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484623377-16208-1-git-send-email-baoyou.xie@linaro.org> References: <1484623377-16208-1-git-send-email-baoyou.xie@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170116_193258_646203_DB41F293 X-CRM114-Status: UNSURE ( 9.12 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c00:0:0:0:233 listed in] [list.dnswl.org] 0.0 HK_RANDOM_ENVFROM Envelope sender username looks random -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, xie.baoyou@zte.com.cn, linux-kernel@vger.kernel.org, chen.chaokai@zte.com.cn, wang.qiang01@zte.com.cn, baoyou.xie@linaro.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Add the zx2967 reset controller driver as maintained by ARM ZTE architecture maintainers, as they're parts of the core IP. Signed-off-by: Baoyou Xie --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/MAINTAINERS b/MAINTAINERS index e63063b..5fb9b62 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1987,9 +1987,11 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Maintained F: arch/arm/mach-zx/ F: drivers/clk/zte/ +F: drivers/reset/reset-zx2967.c F: drivers/soc/zte/ F: Documentation/devicetree/bindings/arm/zte.txt F: Documentation/devicetree/bindings/clock/zx296702-clk.txt +F: Documentation/devicetree/bindings/reset/zte,zx2967-reset.txt F: Documentation/devicetree/bindings/soc/zte/ F: include/dt-bindings/soc/zx*.h From patchwork Tue Jan 17 03:22:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 91600 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp308060qgi; Mon, 16 Jan 2017 19:33:22 -0800 (PST) X-Received: by 10.98.210.3 with SMTP id c3mr41040416pfg.7.1484624002462; Mon, 16 Jan 2017 19:33:22 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id q21si23433610pgg.333.2017.01.16.19.33.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jan 2017 19:33:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cTKWP-0000NA-5o; Tue, 17 Jan 2017 03:33:21 +0000 Received: from mail-pf0-x22e.google.com ([2607:f8b0:400e:c00::22e]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cTKW8-0008CT-IU for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2017 03:33:06 +0000 Received: by mail-pf0-x22e.google.com with SMTP id f144so58183385pfa.2 for ; Mon, 16 Jan 2017 19:32:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FHXaVEoRm9dQDSRmPpNFftQRvN+5/mQZtsEqvw9KvV8=; b=Xpv1IJP7jwxFQxD6oJFlFM5BohRJsWxXUu1eqzc8xdQYJuUl36xS6nlPM6/fZox/st fyWu1+pVxTt0L+ZHrNhE+GP0Pk6BQFuzWDWOVEiYgSD5BdrDCJY/T3X+M47Rc+DhoVeC CQ4dKz3G1SkyPNjWLGfNlM4EFQTAqDmOUNT1o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FHXaVEoRm9dQDSRmPpNFftQRvN+5/mQZtsEqvw9KvV8=; b=AS7wL1bEOpbMydNlEZDpV8wdcu88ud5pfPIu/CcXGQZ1yo2sM6/fSxhY5DFjpvhpS0 nPGgcCfunQt1VHDo2W7hNQ1b883k+P9UJbz2cJr6Tn8mUYNSh1SrWkR66O/9DdXV3Dqc ysLX44MKynZBjBDInjizxPxH8MPTK8ZvVvxMZjG6H6SJopTvohYGGzDvKsTOKI6aG/et eoUQ0yUvndJSf7FbRBMexv6N44Gpta2Rj6yjDsiUE3YgVpJCvduNMdSiaecpuvEJZCHj 5Pxe9CpFy1w7VWYXRxV4ZDwC7F2buaqJ081DHYmyoLZN9ZGv4d3dwRQeAfMM0ebqn3Q3 0xMA== X-Gm-Message-State: AIkVDXIHEZIOHLYBECMmI3uMaHoG/mhjUxgWcAB2FdPMqGIMkVNZbYIO/3edFcEss54lF88l X-Received: by 10.99.144.68 with SMTP id a65mr19258326pge.54.1484623963140; Mon, 16 Jan 2017 19:32:43 -0800 (PST) Received: from localhost.localdomain ([104.237.91.166]) by smtp.gmail.com with ESMTPSA id u124sm51075845pgb.6.2017.01.16.19.32.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 19:32:42 -0800 (PST) From: Baoyou Xie To: jun.nie@linaro.org, p.zabel@pengutronix.de, robh+dt@kernel.org, mark.rutland@arm.com Subject: [PATCH v3 3/3] reset: zx2967: add reset controller driver for ZTE's zx2967 family Date: Tue, 17 Jan 2017 11:22:57 +0800 Message-Id: <1484623377-16208-3-git-send-email-baoyou.xie@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484623377-16208-1-git-send-email-baoyou.xie@linaro.org> References: <1484623377-16208-1-git-send-email-baoyou.xie@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170116_193304_758015_9784CDB2 X-CRM114-Status: GOOD ( 17.80 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c00:0:0:0:22e listed in] [list.dnswl.org] 0.0 HK_RANDOM_ENVFROM Envelope sender username looks random -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, xie.baoyou@zte.com.cn, linux-kernel@vger.kernel.org, chen.chaokai@zte.com.cn, wang.qiang01@zte.com.cn, baoyou.xie@linaro.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org This patch adds reset controller driver for ZTE's zx2967 family. Signed-off-by: Baoyou Xie --- drivers/reset/Kconfig | 6 +++ drivers/reset/Makefile | 1 + drivers/reset/reset-zx2967.c | 106 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 drivers/reset/reset-zx2967.c -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel Reviewed-by: Shawn Guo diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 172dc96..f4cdfe9 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -86,6 +86,12 @@ config RESET_UNIPHIER Say Y if you want to control reset signals provided by System Control block, Media I/O block, Peripheral Block. +config RESET_ZX2967 + bool "ZTE ZX2967 Reset Driver" + depends on ARCH_ZX || COMPILE_TEST + help + This enables the reset controller driver for ZTE's zx2967 family. + config RESET_ZYNQ bool "ZYNQ Reset Driver" if COMPILE_TEST default ARCH_ZYNQ diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile index 13b346e..2cd3f6c 100644 --- a/drivers/reset/Makefile +++ b/drivers/reset/Makefile @@ -13,4 +13,5 @@ obj-$(CONFIG_RESET_STM32) += reset-stm32.o obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o obj-$(CONFIG_TI_SYSCON_RESET) += reset-ti-syscon.o obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o +obj-$(CONFIG_RESET_ZX2967) += reset-zx2967.o obj-$(CONFIG_RESET_ZYNQ) += reset-zynq.o diff --git a/drivers/reset/reset-zx2967.c b/drivers/reset/reset-zx2967.c new file mode 100644 index 0000000..5d82151 --- /dev/null +++ b/drivers/reset/reset-zx2967.c @@ -0,0 +1,106 @@ +/* + * ZTE's zx2967 family reset controller driver + * + * Copyright (C) 2017 ZTE Ltd. + * + * Author: Baoyou Xie + * + * License terms: GNU General Public License (GPL) version 2 + */ + +#include +#include +#include +#include + +struct zx2967_reset { + void __iomem *reg_base; + spinlock_t lock; + struct reset_controller_dev rcdev; +}; + +static int zx2967_reset_act(struct reset_controller_dev *rcdev, + unsigned long id, bool assert) +{ + struct zx2967_reset *reset = NULL; + int bank = id / 32; + int offset = id % 32; + u32 reg; + unsigned long flags; + + reset = container_of(rcdev, struct zx2967_reset, rcdev); + + spin_lock_irqsave(&reset->lock, flags); + + reg = readl_relaxed(reset->reg_base + (bank * 4)); + if (assert) + reg &= ~BIT(offset); + else + reg |= BIT(offset); + writel_relaxed(reg, reset->reg_base + (bank * 4)); + + spin_unlock_irqrestore(&reset->lock, flags); + + return 0; +} + +static int zx2967_reset_assert(struct reset_controller_dev *rcdev, + unsigned long id) +{ + return zx2967_reset_act(rcdev, id, true); +} + +static int zx2967_reset_deassert(struct reset_controller_dev *rcdev, + unsigned long id) +{ + return zx2967_reset_act(rcdev, id, false); +} + +static struct reset_control_ops zx2967_reset_ops = { + .assert = zx2967_reset_assert, + .deassert = zx2967_reset_deassert, +}; + +static int zx2967_reset_probe(struct platform_device *pdev) +{ + struct zx2967_reset *reset; + struct resource *res; + + reset = devm_kzalloc(&pdev->dev, sizeof(*reset), GFP_KERNEL); + if (!reset) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + reset->reg_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(reset->reg_base)) + return PTR_ERR(reset->reg_base); + + spin_lock_init(&reset->lock); + + reset->rcdev.owner = THIS_MODULE; + reset->rcdev.nr_resets = resource_size(res) * 8; + reset->rcdev.ops = &zx2967_reset_ops; + reset->rcdev.of_node = pdev->dev.of_node; + + return devm_reset_controller_register(&pdev->dev, &reset->rcdev); +} + +static const struct of_device_id zx2967_reset_dt_ids[] = { + { .compatible = "zte,zx296718-reset", }, + {}, +}; +MODULE_DEVICE_TABLE(of, zx2967_reset_dt_ids); + +static struct platform_driver zx2967_reset_driver = { + .probe = zx2967_reset_probe, + .driver = { + .name = "zx2967-reset", + .of_match_table = zx2967_reset_dt_ids, + }, +}; + +builtin_platform_driver(zx2967_reset_driver); + +MODULE_AUTHOR("Baoyou Xie "); +MODULE_DESCRIPTION("ZTE zx2967 Reset Controller Driver"); +MODULE_LICENSE("GPL");