From patchwork Mon Feb 19 18:14:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 13562970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF7FE481A7; Mon, 19 Feb 2024 18:14:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708366466; cv=none; b=WGAwwxzjgHJeuDch9/c0lZdKxr+GDOW2HrUbLaqv8jA53Avnsjt/5f9xMXJoyg8JyzRAidfCbS3Hw4X5nb9CVmTjFDaxdSAf9Lm1hSCWFdLizbf2BZCP9w64TNpTYlv5nyK781q2fnYLfhuHbhBEpmnwrnd+SrUZwjohZbOh6I8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708366466; c=relaxed/simple; bh=O+gac3yrsv2rOFibZ4kRZ9MSQo41/MsQ6GdSbvpMomU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=o2oRxUjcO3Ea6gTrDruuF5247FhZD2dfj3yC/SIhOXZzhxVuzvCmnGg788N8CNf4Z8W5gS6N6EYGec77GumBl8o4t+BnQSiRbJ8iihUjAxpJwXwL/Ld28cDP32yYGxDtClWt/qTLuK838ryCGl5YxLnH0NlKybbphCC5kdgtt+o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Bcjaxj6y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Bcjaxj6y" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8046CC433F1; Mon, 19 Feb 2024 18:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708366465; bh=O+gac3yrsv2rOFibZ4kRZ9MSQo41/MsQ6GdSbvpMomU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Bcjaxj6yVSWWJOJ0LtIaQaOZ7YpN8xGtKUyxWMNm4zTcPmXCo3BAGT5AvyzkTg4+D HT4Yvtkk6avc8b0pxs2HJP5S2Xp4HbFMuGcue98V8wjYjAjQyv9IyljiVhwf4SAXYP N/Ok02GGIil4daiaLLTKwzjNJlUTStnzbYXYNJkJ9YJopahgT0MlgUQg7YIn1yhinW oarClhBrymCbf/bXpOeBXp/7JsW51cbn4EzQdh0txvXdnnexJiWrrfgqxFN7YQvTKM eOgyN/dRR/3FKv1DBJfCV0KLzMZ3UGS+YmYJoO42fbKt0OTNyaWiOukC46Dq1xK95c QLjY3ODEoZGIQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E174C54764; Mon, 19 Feb 2024 18:14:25 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Tue, 20 Feb 2024 02:14:25 +0800 Subject: [PATCH v2 1/2] watchdog: sp805_wdt: deassert the reset if available Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240220-hisi-wdt-v2-1-63edc4965b4c@outlook.com> References: <20240220-hisi-wdt-v2-0-63edc4965b4c@outlook.com> In-Reply-To: <20240220-hisi-wdt-v2-0-63edc4965b4c@outlook.com> To: Wim Van Sebroeck , Guenter Roeck , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Viresh Kumar Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708366465; l=1680; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=Ni3PL21dVfacX58NyroZjoZbD5lmIJt2JGNnhuDX6xI=; b=PrBA7WqGLAiZ5soLMgAGUcPHe80L3qvrMa1YCgw+lIjiZRPgunPC/QJ1gC7Uhjf+LEotU467B PvLM+7GxjLJBrZn9tW4NIuMFS0RPOBYdCLLihFM3kfBALus2ZLCjFfr X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: From: Yang Xiwen According to the datasheet, the core has an WDOGRESn input signal that needs to be deasserted before being operational. Implement it in the driver. Signed-off-by: Yang Xiwen --- drivers/watchdog/sp805_wdt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index 2756ed54ca3d..b4bcfdeb39e6 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ * @lock: spin lock protecting dev structure and io access * @base: base address of wdt * @clk: (optional) clock structure of wdt + * @rst: (optional) reset control signal of wdt * @rate: (optional) clock rate when provided via properties * @adev: amba device structure of wdt * @status: current status of wdt @@ -69,6 +71,7 @@ struct sp805_wdt { spinlock_t lock; void __iomem *base; struct clk *clk; + struct reset_control *rst; u64 rate; struct amba_device *adev; unsigned int load_val; @@ -264,6 +267,12 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id) return -ENODEV; } + wdt->rst = devm_reset_control_get_optional(&adev->dev, NULL); + if (IS_ERR(wdt->rst)) + return dev_err_probe(&adev->dev, PTR_ERR(wdt->rst), "Can not get reset\n"); + + reset_control_deassert(wdt->rst); + wdt->adev = adev; wdt->wdd.info = &wdt_info; wdt->wdd.ops = &wdt_ops; From patchwork Mon Feb 19 18:14:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 13562971 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFA5D481AB; Mon, 19 Feb 2024 18:14:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708366466; cv=none; b=eFzPIs+WqxHaiPdJzkWb+RB1bBB/a+NFFRwicqimALyPFCSv1lMOyfia7giSlyBPNYwGl5ZZD+NLtheabLYSQdIcku0oLzxZpBdscvPXFN+GugKMNztY2MC4ECt8T9PuwCNUjydGFCmJbgkeRz20o6WeOf7xZ23qXI5b4oj/I5E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708366466; c=relaxed/simple; bh=lI9ZJUjL9ybYuRVZPP8gR27T34yW1aM09ufVi90sVcU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=prO+2tysoaDStzN5oowhEFoV+8vlfkprjG4j09dNeeKShHWPbXTHBcRnawqUEECvtBJsM9qmbEPu1xt11M3/U0oWFSDJMYXLs1b4V9+fhVyeQHgOv+6y8BiMgMrtqJIDpl2ZdDNXxX2ENmgMlHfN3JF5erGVkqE94dYLA/yuht8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ucmLAF/B; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ucmLAF/B" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8C5AEC43394; Mon, 19 Feb 2024 18:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708366465; bh=lI9ZJUjL9ybYuRVZPP8gR27T34yW1aM09ufVi90sVcU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ucmLAF/B5eTgPnHUOBqtBQ4THscpCui0NFbA3cDzLIOEOOBgOcu7DIpvLY7IHa0OQ bore+x2/ASI9mT3xjDSz21ThdIeaAqcnjGJy1JSWY6qkJL0yRiuQdXvH3JCv+chD64 +kgciaLMJfi2hNw8zuHTUXTn7/vVFkbPe2SmqOI63m0q/yWEwe/gdrjdDgQiCTsWED DxUgs4P9xEIZD41i/1d/GYypC9YcwqYyKmVKYn6uFiFLptqH1QNa0YkC9uptEywl/d 65BmOrbaIOJs4aBW5PNLQ3RIBInGzpSbOAOPm2D5YTGCOCgeSPcK8Cg+t7XdMlbCRy 2LKV5CLeEWVNw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D0EBC48BC3; Mon, 19 Feb 2024 18:14:25 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Tue, 20 Feb 2024 02:14:26 +0800 Subject: [PATCH v2 2/2] dt-bindings: watchdog: arm,sp805: document the reset signal Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240220-hisi-wdt-v2-2-63edc4965b4c@outlook.com> References: <20240220-hisi-wdt-v2-0-63edc4965b4c@outlook.com> In-Reply-To: <20240220-hisi-wdt-v2-0-63edc4965b4c@outlook.com> To: Wim Van Sebroeck , Guenter Roeck , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Viresh Kumar Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Yang Xiwen , Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708366465; l=1096; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=Y/0S+rlwzPt8yQv5SlX93rhiayW10MfuG7cp9vIgSlo=; b=74+vFdustM4jpfDiqXRrX52ettc3+5FsfpFWBdwErZQESubrKlLo/hEYyYhs3NwNvVUwfmAcz mIV0+fgFjDlC5SMtcaITXYcskRk3um5HuiO+azexYWsZq1s2a0oKuNX X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: From: Yang Xiwen The reset signal needs to be deasserted before operation of sp805 module. Document in the binding. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Yang Xiwen --- Documentation/devicetree/bindings/watchdog/arm,sp805.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/watchdog/arm,sp805.yaml b/Documentation/devicetree/bindings/watchdog/arm,sp805.yaml index 7aea255b301b..bd7c09ed1938 100644 --- a/Documentation/devicetree/bindings/watchdog/arm,sp805.yaml +++ b/Documentation/devicetree/bindings/watchdog/arm,sp805.yaml @@ -50,6 +50,10 @@ properties: - const: wdog_clk - const: apb_pclk + resets: + maxItems: 1 + description: WDOGRESn input reset signal for sp805 module. + required: - compatible - reg @@ -67,4 +71,5 @@ examples: interrupts = ; clocks = <&wdt_clk>, <&apb_pclk>; clock-names = "wdog_clk", "apb_pclk"; + resets = <&wdt_rst>; };