From patchwork Sat Jan 14 07:05:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 91504 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp541258qgi; Fri, 13 Jan 2017 23:06:44 -0800 (PST) X-Received: by 10.84.129.111 with SMTP id 102mr35473928plb.103.1484377604483; Fri, 13 Jan 2017 23:06:44 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id s136si14884914pgs.329.2017.01.13.23.06.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 23:06:44 -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 1cSIQE-0006sZ-PF; Sat, 14 Jan 2017 07:06:42 +0000 Received: from mail-pg0-x22c.google.com ([2607:f8b0:400e:c05::22c]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cSIQ9-0006rf-QF for linux-arm-kernel@lists.infradead.org; Sat, 14 Jan 2017 07:06:40 +0000 Received: by mail-pg0-x22c.google.com with SMTP id 204so1341775pge.0 for ; Fri, 13 Jan 2017 23:06:16 -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=P9BiTsOQJ0Vj5Jn6ekQwO2WUYce/fKvtKlBL59OL0xI=; b=D84nTDYD0JtMgBM1xcnZk1nUWH4N3dKRK7tazydlEl3nljHzqVUwyEq07yJmBt7HPv TSSwbwNsCoCJmnQRwlMOwwJwFZ31Q5V3N0ORDmTfED6wTNi/X0/yZ/t+YomtuLYXxG2u STYaQlLr25CFXiYCmo86U4ApxOX5eshKugDc4= 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=P9BiTsOQJ0Vj5Jn6ekQwO2WUYce/fKvtKlBL59OL0xI=; b=JEa7RFf0lhbv1LCec8WKM6wumGmuzV48S7Le00AsDIhAZGfs+Ui6vczTkToFK2qipC WIhR0rya/ZKTqCfV7mMynaTormEqp1BOp1+WEwVqUFe+fu6p2FiYLNcZrzGyKW/GhmeH mZc6xYl2ac9rpHPGEUITYqQERotH+nORxVxk1PcAOo16jJJIFSFqpq+zaKYQ7IRgzPlO ep5fgxGbMeugzPnxFIlDwpKNYwOPqn90AwHgSoonraHo0/6NyvB86x7wN0827yqN5inG LYdjYlB6JvptnmfwTOBIHPMW2kqyXbRnmZBxp90nSg1K+Ikc44paXFwHXVD3iCpgj+lx j66Q== X-Gm-Message-State: AIkVDXId1kjd3HYDOsNv6reKehYqy288E+mNVt0TU+1q5Mh/q9nRWr/9zvqxdZqz450FVRqL X-Received: by 10.84.232.67 with SMTP id f3mr34885597pln.55.1484377576419; Fri, 13 Jan 2017 23:06:16 -0800 (PST) Received: from localhost.localdomain ([104.237.91.20]) by smtp.gmail.com with ESMTPSA id t21sm33246201pfa.1.2017.01.13.23.05.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 23:06:15 -0800 (PST) From: Baoyou Xie To: jun.nie@linaro.org, p.zabel@pengutronix.de, robh+dt@kernel.org, mark.rutland@arm.com Subject: [PATCH v1 1/3] dt: bindings: add documentation for zx2967 family reset controller Date: Sat, 14 Jan 2017 15:05:28 +0800 Message-Id: <1484377530-30635-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-20170113_230637_884953_3C3F7889 X-CRM114-Status: GOOD ( 10.37 ) 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 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 -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c05:0:0:0:22c listed in] [list.dnswl.org] 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 --- .../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..22d590e --- /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: + + toprst: reset@1461060 { + compatible = "zte,zx296718-reset"; + reg = <0x01461060 0x8>; + #reset-cells = <1>; + }; From patchwork Sat Jan 14 07:05:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 91505 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp541324qgi; Fri, 13 Jan 2017 23:07:00 -0800 (PST) X-Received: by 10.84.141.164 with SMTP id 33mr34936653plv.86.1484377620377; Fri, 13 Jan 2017 23:07:00 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id r11si14889723pgn.300.2017.01.13.23.07.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 23:07:00 -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 1cSIQU-0007Bi-4Q; Sat, 14 Jan 2017 07:06:58 +0000 Received: from mail-pg0-x234.google.com ([2607:f8b0:400e:c05::234]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cSIQO-0006s3-B7 for linux-arm-kernel@lists.infradead.org; Sat, 14 Jan 2017 07:06:54 +0000 Received: by mail-pg0-x234.google.com with SMTP id f188so1335283pgc.3 for ; Fri, 13 Jan 2017 23:06:31 -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=8MzbK0sV9rEn1XZrg4GCXb97emrrA4/8l312dSPllpk=; b=VS4LhtlAXrO1Gu/SewSaZFJJ7z3VOZxAp2XBJ5gGKVEEIQ1EdrefNy8ehVKJA07wtU QsHy6V8g9Y4bWKrX4C4J1McTbzE7UIoCBRi8Uf5KlqYKIMy4BF0R3HTxf5PtKsX15ZS8 T1vMXqDR5qXfLPimTBSWklRDsciSGL4HEXUxs= 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=8MzbK0sV9rEn1XZrg4GCXb97emrrA4/8l312dSPllpk=; b=Ko7mvjwH+HGpouFKNLrmbiJKYBrayI1C90LtvAMW6NbR4GUKqJ39LNBv4+Op8qu4Kk 31eV32PscOb4tkNk3Cf2DinQepzAKNUniUc8DLYEbm5qZx48ew8zCoCzKwNH6DAoK/fs 6nnozDeLsosC8ENMRhrW5z5CJ+jkiV2f2ztkL7MlkyCCuuNoOMUDpJ8wzobwHpfG+1xB RwXae+4klp+ehpSst+XjorowtE0EDbIHpv9hUwi3+C4PpN6SOqVogr+r4qFHay7vSfvk OeYY1mZgepCVcXxemtcrAOG3xSV/qyIM7NJPf3aUTT6Sdk9xfj6U12+g1q1vYhc+JM/f M2MQ== X-Gm-Message-State: AIkVDXInPvwgsQrV36ldGqupx+iJpcxPgTDs1jNUpIFBQ0WmRij3FKHK6uHBJJgo4YzYuFbg X-Received: by 10.84.179.67 with SMTP id a61mr34393390plc.98.1484377591556; Fri, 13 Jan 2017 23:06:31 -0800 (PST) Received: from localhost.localdomain ([104.237.91.20]) by smtp.gmail.com with ESMTPSA id t21sm33246201pfa.1.2017.01.13.23.06.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 23:06: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 v1 2/3] MAINTAINERS: add zx2967 reset controller driver to ARM ZTE architecture Date: Sat, 14 Jan 2017 15:05:29 +0800 Message-Id: <1484377530-30635-2-git-send-email-baoyou.xie@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484377530-30635-1-git-send-email-baoyou.xie@linaro.org> References: <1484377530-30635-1-git-send-email-baoyou.xie@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170113_230652_453225_464A1423 X-CRM114-Status: UNSURE ( 8.14 ) X-CRM114-Notice: Please train this message. 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c05:0:0:0:234 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 2793808..08f8155 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1980,10 +1980,12 @@ 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: drivers/thermal/zx* 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: Documentation/devicetree/bindings/thermal/zx* F: include/dt-bindings/soc/zx*.h From patchwork Sat Jan 14 07:05:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 91506 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp541369qgi; Fri, 13 Jan 2017 23:07:11 -0800 (PST) X-Received: by 10.98.15.143 with SMTP id 15mr18311162pfp.100.1484377631653; Fri, 13 Jan 2017 23:07:11 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id c78si14955852pfb.0.2017.01.13.23.07.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 23:07:11 -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 1cSIQg-0007VQ-0P; Sat, 14 Jan 2017 07:07:10 +0000 Received: from mail-pg0-x234.google.com ([2607:f8b0:400e:c05::234]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cSIQY-0006wu-09 for linux-arm-kernel@lists.infradead.org; Sat, 14 Jan 2017 07:07:05 +0000 Received: by mail-pg0-x234.google.com with SMTP id f188so1336415pgc.3 for ; Fri, 13 Jan 2017 23:06:45 -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=BQ7mQRphCn/Qwse/9Z/zC5T9RsCV765Bkq0mqDFCOjA=; b=PbJNyKtdQaJcRKCEkJ9JC5axiTyefLbTMamfhCCjDLFKO9oYs4B3fvm/LAys+n04+L u5Ofi4pZXNz3CEhruAiqgVEOO3SJLb2if2V+O435no1f7aSq9/HIUr05JrGij76NSB4s veIUF9I5keW8018i45r7k0fGlYuccfHLvRZdA= 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=BQ7mQRphCn/Qwse/9Z/zC5T9RsCV765Bkq0mqDFCOjA=; b=VBUxXhCegGKrmFLclG4J5y1Eu/GnVdM++sq5Rg1H1xtmWMfcaOY7WM9k56SySLB33A aVVdIZUMcbJ+gnxkecf9LrEXkxv/i/RQY1M4hCjgviAY3u8scQ7JzRoB1LDgzfTFcqZe ey1o9O6w5rPN0Rxs9lubl+u3gRfNstTWbOcrydHpsAMcWWMrvyVbvwO7CxGxlh/o9Olr yMSOvsUHpxZBpwKbQGtlVK9lY+XhioWahWfcu54F8uwYeN7qAkONPvLYrXjnCIcK+HPS imISfi6If7qDmfJa3xoumCD9ACUQX2N8ufnrtNyW4I3BbjcD3Grk/js7hiysena0ym38 +aag== X-Gm-Message-State: AIkVDXK7jHmD56sE8J3+/34X0Ye3seOVGVhDFJ/ywnm/7GgD2Z8Y3wrLdnyxYqtM6qF2a3MX X-Received: by 10.84.136.7 with SMTP id 7mr22012171plk.100.1484377605329; Fri, 13 Jan 2017 23:06:45 -0800 (PST) Received: from localhost.localdomain ([104.237.91.20]) by smtp.gmail.com with ESMTPSA id t21sm33246201pfa.1.2017.01.13.23.06.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 23:06:44 -0800 (PST) From: Baoyou Xie To: jun.nie@linaro.org, p.zabel@pengutronix.de, robh+dt@kernel.org, mark.rutland@arm.com Subject: [PATCH v1 3/3] reset: zx2967: add reset controller driver for ZTE's zx2967 family Date: Sat, 14 Jan 2017 15:05:30 +0800 Message-Id: <1484377530-30635-3-git-send-email-baoyou.xie@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484377530-30635-1-git-send-email-baoyou.xie@linaro.org> References: <1484377530-30635-1-git-send-email-baoyou.xie@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170113_230702_137277_766CCA0C X-CRM114-Status: GOOD ( 16.44 ) 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c05:0:0:0:234 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 | 136 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 143 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 diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 172dc96..972d077 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -92,6 +92,12 @@ config RESET_ZYNQ help This enables the reset controller driver for Xilinx Zynq SoCs. +config RESET_ZX2967 + bool "ZX2967 Reset Driver" + depends on ARCH_ZX || COMPILE_TEST + help + This enables the reset controller driver for ZTE zx2967 family. + source "drivers/reset/sti/Kconfig" source "drivers/reset/hisilicon/Kconfig" source "drivers/reset/tegra/Kconfig" diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile index 13b346e..807b77b 100644 --- a/drivers/reset/Makefile +++ b/drivers/reset/Makefile @@ -14,3 +14,4 @@ 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_ZYNQ) += reset-zynq.o +obj-$(CONFIG_RESET_ZX2967) += reset-zx2967.o diff --git a/drivers/reset/reset-zx2967.c b/drivers/reset/reset-zx2967.c new file mode 100644 index 0000000..63f9c41 --- /dev/null +++ b/drivers/reset/reset-zx2967.c @@ -0,0 +1,136 @@ +/* + * ZTE's zx2967 family thermal sensor 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_assert(struct reset_controller_dev *rcdev, + unsigned long id) +{ + struct zx2967_reset *reset = NULL; + int bank = id / 32; + int offset = id % 32; + unsigned int reg; + unsigned long flags; + + reset = container_of(rcdev, struct zx2967_reset, rcdev); + + spin_lock_irqsave(&reset->lock, flags); + + reg = readl(reset->reg_base + (bank * 4)); + writel(reg & ~BIT(offset), reset->reg_base + (bank * 4)); + reg = readl(reset->reg_base + (bank * 4)); + + spin_unlock_irqrestore(&reset->lock, flags); + + return 0; +} + +static int zx2967_reset_deassert(struct reset_controller_dev *rcdev, + unsigned long id) +{ + struct zx2967_reset *reset = NULL; + int bank = id / 32; + int offset = id % 32; + unsigned int reg; + unsigned long flags; + + reset = container_of(rcdev, struct zx2967_reset, rcdev); + + spin_lock_irqsave(&reset->lock, flags); + + reg = readl(reset->reg_base + (bank * 4)); + writel(reg | BIT(offset), reset->reg_base + (bank * 4)); + reg = readl(reset->reg_base + (bank * 4)); + + spin_unlock_irqrestore(&reset->lock, flags); + + return 0; +} + +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; + + dev_info(&pdev->dev, "reset controller cnt:%d", + reset->rcdev.nr_resets); + + return reset_controller_register(&reset->rcdev); +} + +static int zx2967_reset_remove(struct platform_device *pdev) +{ + struct zx2967_reset *reset = platform_get_drvdata(pdev); + + reset_controller_unregister(&reset->rcdev); + + return 0; +} + +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, + .remove = zx2967_reset_remove, + .driver = { + .name = "zx2967-reset", + .of_match_table = zx2967_reset_dt_ids, + }, +}; + +static int __init zx2967_reset_init(void) +{ + return platform_driver_register(&zx2967_reset_driver); +} +arch_initcall(zx2967_reset_init); + +static void __exit zx2967_reset_exit(void) +{ + platform_driver_unregister(&zx2967_reset_driver); +} +module_exit(zx2967_reset_exit); + +MODULE_AUTHOR("Baoyou Xie "); +MODULE_DESCRIPTION("ZTE zx2967 Reset Controller Driver"); +MODULE_LICENSE("GPL");