From patchwork Mon Jan 13 11:23:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 857200 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09985233122; Mon, 13 Jan 2025 11:24:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736767442; cv=none; b=PekrMrysPQMjqjdepTwvJwkVeHdQMfiBsxlLRalntsP8vmrI165sYuPKeYw8z8rsozFh4gzd4EalJ4CNb5awhWb11XzSQnXlyk13sqi+XBMJOMYZwtJUSmiVJ3vcwYKResuQYfEPUbFEVtKabilwR6N7CmUOw/oSvo9mHX4600M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736767442; c=relaxed/simple; bh=VGm5fga+qdheliLjGeEyYro60M9aWj5XFzDRrK6bJgc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vp9RDY/xUikDMuSud4OgIelH1kcFhjbS9BpRV/fW+GhHk5hhcnWGXcc9qZ7xJLdkZcDokAyX7wLVrtqguO2LyhwATPFoug3Vm0OQhThHwKkbdkwLMOFR0bbPmod3QOILiox7K1VEtHGJPWgWHzEFf4D0UjkhkoqLNNl/IxAGKGM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UaSc/znW; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UaSc/znW" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4361f796586so42617845e9.3; Mon, 13 Jan 2025 03:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736767439; x=1737372239; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=87ynWBBN6shlZiHmco9EO3S+qlCl+GXkGnpEybw0HzE=; b=UaSc/znW08iGe2jsAoZ9dcjIfD+3/Qd9Gfaa7ishPw4dx+p0kfuv1zTlybTzNm6faq 1BLNJXBxGtc7mNcCNDMT9n12DbgkBYo4MmNltBDdBPyHUHhJNraXxs99a6z1JG19C97n i+hhWp48vqH9ZK02UO+WiAQPyOmhEnF+qrvIlFwtTgz/vQNjEci+YQrJD1UWQIRbr44Q +P4HMLvR5m2PovD9WLrRNzXGop5uoH1gYOLJ3Nw8SSb3ZoMErmIK+czzM0QlNn0mRXK8 EAtBCcwUzcKJqXLN9o+QNI7f1Fom1GEJLWgMFnlISFPfc9TnsegC77vW4CvWv4UX/K69 rgng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736767439; x=1737372239; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=87ynWBBN6shlZiHmco9EO3S+qlCl+GXkGnpEybw0HzE=; b=bL+ZXrtTH7UOaDx/ebCz9ZijKPXxHlqRqjgWzEKAWQH8gSXxoU1NaAAE+84UomCgPG +rKYZenTxhFy53cAeDQhvS2E3S1W544f7HAmMfq6Cw2H/1AUPH4FtAlzXs6MOda5iOfV r3Mm3dDGSff+oWp+1aVLaKvWPLwKml8TcS1AVCIdpYDAEpqVI5XPAc2d2gxwDQVB7h0v MVtg+QDrun1AhgwE/lpzkEdCGLpLGu2Z+xtO3budNkPSs6bMeGHwnDuaulFFIGNvlObC yKLD6ydhQRu5m0zxQ9MDyOYduq8kcsq4vJ0lVh14cC0eDwF/6qQ4R6M88nxi6FnberHq 7M3g== X-Forwarded-Encrypted: i=1; AJvYcCU04Cme5Lg1g4LBBwWCnN3Wo+r1QkNZyJ5nk1LvUjLSSz39YxnkZARzPglavUCHzCujaNiooZopDpNcD+AagcI=@vger.kernel.org, AJvYcCUBZ/ua9fE1sgVYkscrVJyxTU25Rl3YY4ox4dWX7WlYXJMEmowmneRSHK/U4mpa8+NBruTj7zBGrDKB@vger.kernel.org, AJvYcCUUkx/irHmnTzQPTfYwjkMknjgFaswfLuV68Un0R8tTwW2llDyagWFVyBRCZTQiAaPMg5M4x5gyiw8n@vger.kernel.org, AJvYcCWBZQ3FBSDlCXotft8oajwnZNn9sknLRFkVgtC0+Ck771DJSW2uS3xOoEOaPsHLmdfgva1lgLrxVH5iXBre@vger.kernel.org X-Gm-Message-State: AOJu0YyY77XJiXsli/Ab3Loi2NJIDkg/gRoR5aGIXPeK0qxH36gywLif eWOemIgDNtqwrqLCEE1p2fzPDeyF+hpXZyzQba9+aaMKm21mE/IC X-Gm-Gg: ASbGncu9N1aozWh7wc6Lxg6/ACjrpgOuXSnuXxM8vfM/TsdnuxF/cZcXzQ+gtlE76Rw YSR87T46HRv5waKJcgnHlzUY46loQwUiVwtqq2mU1EVeMkILgMuc23vJsDPx/sg9j6bVhOzX/hJ WQBKkkhNwMGVmzRF7Uquko1Wmvbm3KpWMI1/PLVsyf5me2pgaV3zKTSeLmU+D+hHG0EG9E1E8P6 7txDXuV/xa6C2w6/P0Njpgl2GoVE2tlWh9SzWmy4nRn+aKwgUdwba50QPzb+tDJpjeoth95u63s fXh0+jvk7g== X-Google-Smtp-Source: AGHT+IE/mUiSJ81CNgzk9veUFRx+nmoZdMNXo5iFJWm+dHgqOt9C4PSipf9QO3XW0VZq6fwQycFKPg== X-Received: by 2002:a05:600c:a0a:b0:434:a04d:1670 with SMTP id 5b1f17b1804b1-436e25548e3mr79102305e9.0.1736767439168; Mon, 13 Jan 2025 03:23:59 -0800 (PST) Received: from prasmi.Home ([2a06:5906:61b:2d00:acc9:404c:3a6c:d1aa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436f04df606sm107597115e9.12.2025.01.13.03.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 03:23:58 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Wim Van Sebroeck , Guenter Roeck , Magnus Damm , Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v3 1/6] dt-bindings: clock: rzv2h-cpg: Add syscon compatible for CPG block Date: Mon, 13 Jan 2025 11:23:44 +0000 Message-ID: <20250113112349.801875-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113112349.801875-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250113112349.801875-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar The CPG block in the RZ/V2H(P) and RZ/G3E SoCs includes Error Reset Registers (CPG_ERROR_RSTm). A system reset is triggered in response to error interrupt factors, and the corresponding bit is set in the CPG_ERROR_RSTm register. These registers can be utilized by various IP blocks as needed. For example, specific bits in these registers indicate resets caused by events such as underflow or overflow of the watchdog timer. This functionality allows the watchdog driver to determine whether the current boot resulted from a `Power-on Reset` or a `Watchdog Reset`. Add the syscon-compatible property to the RZ/V2H(P) and RZ/G3E CPG block, allowing drivers to interact with the CPG_ERROR_RSTm registers as required. Signed-off-by: Lad Prabhakar --- Note, there is no ABI breakage as, this series adds the first `syscon` user and also note the driver doesnt fail if the `syscon` property isnt present in the cpg node to handle backward compatibility. --- v2->v3 - No change v1->v2 - No change --- .../devicetree/bindings/clock/renesas,rzv2h-cpg.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/renesas,rzv2h-cpg.yaml b/Documentation/devicetree/bindings/clock/renesas,rzv2h-cpg.yaml index c3fe76abd549..f42d79e73e70 100644 --- a/Documentation/devicetree/bindings/clock/renesas,rzv2h-cpg.yaml +++ b/Documentation/devicetree/bindings/clock/renesas,rzv2h-cpg.yaml @@ -17,9 +17,11 @@ description: properties: compatible: - enum: - - renesas,r9a09g047-cpg # RZ/G3E - - renesas,r9a09g057-cpg # RZ/V2H + items: + - enum: + - renesas,r9a09g047-cpg # RZ/G3E + - renesas,r9a09g057-cpg # RZ/V2H + - const: syscon reg: maxItems: 1 @@ -73,7 +75,7 @@ additionalProperties: false examples: - | clock-controller@10420000 { - compatible = "renesas,r9a09g057-cpg"; + compatible = "renesas,r9a09g057-cpg", "syscon"; reg = <0x10420000 0x10000>; clocks = <&audio_extal_clk>, <&rtxin_clk>, <&qextal_clk>; clock-names = "audio_extal", "rtxin", "qextal"; From patchwork Mon Jan 13 11:23:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 857199 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CB072451C0; Mon, 13 Jan 2025 11:24:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736767445; cv=none; b=rN9oDFhThuiVtDnRJCvkITl8e6VGmXJtULeeIQU5Y6ZSewiQvO67Hjn/VwxWRUENbet70vHyA2TBcA1L1pVDLtGPyQdOC5D81f59elNTBoxM2R3gDsKx24e63LzLm4s6k7apFrrUU3XTGUl/SlG5NBDvOrN6OcDPV2c6xMjQupM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736767445; c=relaxed/simple; bh=VZQhzkAi+f7HNeJ5UXFl8wKeHOQjQ5O+04D4CkQZn8s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sRieZUwoYFrixGb1qfAVA28woDdJGns9ciao2Qa/moHYSKOi93WuQrIZi+sD9++CsA+vE3lKdvyJ5hQntqGcmFDRgVwfTf/RlWjqoibHorVx6FqBmRKRqun3A3WCsQU709CayAlTMm9UJzWSvbW67uQgwk35SJJ1hAXDCP6eAq0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OZ0sBvzq; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OZ0sBvzq" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-43621d27adeso28508095e9.2; Mon, 13 Jan 2025 03:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736767442; x=1737372242; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Wf+FxyAJJ9Wc8AZUpI7y2tkoMuoQOHrn1/o6c+UYRhs=; b=OZ0sBvzq366DLb+ZGl6kvkmTO5GHNDGRGoxWpX7hkunrxott4KiXyHA+KhFNZpRVxp jzwf64X+lZSCx4WAsfIzB7eaG1U+DG8JX+SsgRVtGO93mJ/RioGbM6pLuh+roAckTHoU bfprA+CzhrbhrYYbNTQ1O447PJTXaXMw7c+eohac98Yh0vUte3dny9UbIulZ1FRpKSnX ztPXptv3APxyczAkcK++14pZrphXqC56TXnPLbx00vAke7qAQE3hswE7gdERj5PW6Rdf a6duu0SBi4l85a4X7G2D6JYrj+MpdqjR9h3qPgy+wWT+TuJY/w/Itk52draUS8KF1lck 3P4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736767442; x=1737372242; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wf+FxyAJJ9Wc8AZUpI7y2tkoMuoQOHrn1/o6c+UYRhs=; b=wtWGfDlLRmFMEk5NZK5lO/tvodMCk3pBxqiace2YeIIwqSfNbYNZ4phS8C2aUvSzKs x/jeuM11hCWMEup0hD4lA+fdJesKLFVuCgnCz5ab50v/5XXMbYzLatqWxmEtu77+Y3pE F0zUF5taE3G3oSEWa/XT7OaLK+hNOS7MM1Nl1rkZWiy/YWzmcKn+y/H1N496RGlurDQT gF5Co7ucRr3lDzUjP62lT6IOhWIEN/2hapWtuHcVIfeokwbt/TaGOX2R0z7kbTIc98oo JM4L8U6TIiQAlTMMPKBNsigEnLtGo6Dgz+m9VZ/I7iBkVjx8J75rnxY0Gktxhhq8lN4X AoUg== X-Forwarded-Encrypted: i=1; AJvYcCU0Jf6Qc0Lk3pMXduKlLsN8cSj8/1tRHs6Hkt0AIjH3sXBYvZK28L8RBphlh4CmjWY+hy43b4NeBzf3RQvR8/k=@vger.kernel.org, AJvYcCXYKo3KBFA272qEU67apulFRRl6y9GdBMf26YloIVD1YuQ9jF3mxbZJcYW1iB+Ey/urGepQTC37go1L@vger.kernel.org, AJvYcCXf3ImetnopzD/GjqdE1YgDAXAO/AsL3Ms87j9UTXtdRUqYq7ePwktpX0/YE8ilG6U4G987zUnUyFSfFfAS@vger.kernel.org, AJvYcCXkBy16eUWvKYcQC/qh1Z3GGqgRUI25hOUtMiKBsgYf5IEsdHL8t8c/EK8ltLbQ5sAam9C/MNccZqC+@vger.kernel.org X-Gm-Message-State: AOJu0YzxaCd4FyxRJYO2TXD4aS2F6s27ZJaBcsS41mhALvHrajBlHsnn GvopAAji23zwnItPOfk3jjEvNe3Ixr2CWaIM1AQI5sEaVR2w5f0t X-Gm-Gg: ASbGnctybvqeMji9UK0Rnp+UqLJL78biUwTXSAYl/vxWU2MA954pwa/YGG2L3UUJBvL BGh86zQBkuqi609CT938nIWK8/+IxaS+5WEmN3851hcf3AfOpmHoYCHkyclTnb+9Bg3CX+/8CnF BtZ3QuYYeig2kLbAbf3HYvxSAjGtkT62F7/73B+TE7haOvvQn9T2SI4rka0LLpX9FjHZlXl6gpH QAwZnAn+gMwyMUkDz5tg88k3fT8hY6T76rNE3efL8XEAeBlpufWIKL8noCBUtpO/2bpRsvarWm+ /ZT/U2E/lA== X-Google-Smtp-Source: AGHT+IEVDQ0q2fm1/v+6iiU6Jp+0FZ94Ci4/jq3SZzXn8dZfog5A0bBVY72X1f4t/UbMN53FwlaSLw== X-Received: by 2002:a05:600c:3b0c:b0:434:fa24:b84a with SMTP id 5b1f17b1804b1-436e26d96d8mr160948325e9.25.1736767441354; Mon, 13 Jan 2025 03:24:01 -0800 (PST) Received: from prasmi.Home ([2a06:5906:61b:2d00:acc9:404c:3a6c:d1aa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436f04df606sm107597115e9.12.2025.01.13.03.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 03:24:00 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Wim Van Sebroeck , Guenter Roeck , Magnus Damm , Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v3 3/6] arm64: dts: renesas: r9a09g057: Add `syscon` compatible for CPG node Date: Mon, 13 Jan 2025 11:23:46 +0000 Message-ID: <20250113112349.801875-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113112349.801875-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250113112349.801875-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Add `syscon` compatible for CPG node to allow the IP blocks to interact with the CPG registers as needed. Signed-off-by: Lad Prabhakar --- v2->v3 - No change v1->v2 - No change --- arch/arm64/boot/dts/renesas/r9a09g057.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/renesas/r9a09g057.dtsi b/arch/arm64/boot/dts/renesas/r9a09g057.dtsi index 3938b9740959..e7428b80bda2 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g057.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a09g057.dtsi @@ -243,7 +243,7 @@ pinctrl: pinctrl@10410000 { }; cpg: clock-controller@10420000 { - compatible = "renesas,r9a09g057-cpg"; + compatible = "renesas,r9a09g057-cpg", "syscon"; reg = <0 0x10420000 0 0x10000>; clocks = <&audio_extal_clk>, <&rtxin_clk>, <&qextal_clk>; clock-names = "audio_extal", "rtxin", "qextal"; From patchwork Mon Jan 13 11:23:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 857198 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49913246332; Mon, 13 Jan 2025 11:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736767447; cv=none; b=mLvoXNKo+1cgWYDz261kQFgdGlfxniixSBTtANp8dHpWTOgHBTFlVq9go7yhy6uRy56A5chayOqFBUhnVKQMZbQYYQc6EBs/gI6az90XrHrvWNsSCBndlq0jnhcODh03KDgErPRhlLTmlR7lwAXHxGwOnwRboIMymmc/KiEKiFY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736767447; c=relaxed/simple; bh=cPbAQJjzP2jyHa8v1Bo/aUUIhv8bPbqtMqUoapRsqyg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PrGiihE3JpzG65zCB/cQGQjkKjGBxLKs83p+/JMaAsZIy+zX2Gn/iPo48E7Q222vltISgEOwQbrWe57i1fEzZ/Y6Utgs+7Sil7OvG5XVuGmPSREgRFZwO4iw01OF6AfUFpoF0d+0q+fBSx6U0k0ilnHq0AnzsULlYJBqPL1mDHc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=STt99I1d; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="STt99I1d" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-385d7f19f20so2099437f8f.1; Mon, 13 Jan 2025 03:24:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736767443; x=1737372243; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BDEeUg2JBjfBblB/2iud2mGE+Qes+mfomfi7Q9Wqrt8=; b=STt99I1d+jU5uz4RxhHxW8u75CLdwxn9MFhbjzDQHX+DiO7UPtRX0B3rFblkgTXCkC GLVGSEO3DZNk6JhfxHZJQTx9Jeb14a+HGFcpdGoUCk9jx7LCaPcw14ZEPcds4EzQeQJX teE3wS5k9eyV8GwwlkCqWKN9CMIPzZKyA3dbLtJjdkOwFDyLLPZ3KOYu8FizN2JozChG Uqvf6Zl+rI30u+QiQVIkd3XuXB596KY2+SztPWHfwqCycExUUf0usHMvobyBd13vGjye qs0xj9riakK5cDqw8yp+/ZKHHT2FTsQd+w1MIELl5NPDeBCcqKTJ5ZbxYINP8uHvsOum 4/wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736767443; x=1737372243; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BDEeUg2JBjfBblB/2iud2mGE+Qes+mfomfi7Q9Wqrt8=; b=Em/NorFDYB8pUqIA+TFTEQATMC/0xlfX2NIWWtby5ST7HYOMq2++VvLKdw+Mgs+w54 SJ/bc2Vq83UqRx+wK80pA1SQTye1gQ/aLNXmjFLaQB0Ii4CL3zg88Zdp6cCct9bzrQGw wFF81kZeDoPOHdL22TI3q8eY6sa9rToLjnnaJwnY5IefqL3p33bdkXCZoKb1l00+lQe7 51qBXWvN2TB3KJ3HlX/1xo7BgSBtGTs54U3l/sxWcZ8pUeCIk0h2R8XGKxn3fadgovs2 FpVzVhIEDi5TCCJAJH+kslUB+mfCR/+4Vi9HavqWZedCyZRtz/2i0QH0YYrKBZG86pNc Q1Qg== X-Forwarded-Encrypted: i=1; AJvYcCVuih/Bms3H/3GV86dW/ZQTOpQ+J31921IBKPR1h4cO8dl2fATgITZVJ+dJRUZWiVn48B3RKRSNWnSu@vger.kernel.org, AJvYcCWr9tosC6Ypq8PX/0LfMYs7a+EhuWCZcy5uJvJ6h+HBhX0PI84JCWZS6WC3RuIHvGldZTuEw+zGz7exAoEflaI=@vger.kernel.org, AJvYcCXOnaqxRRR03wCugPUm/JXj7ylmFSDkLzJ+pg4guEZ//4pbJzP60lwwxPYSB+fSFB2UnDAygf4A+kSu@vger.kernel.org, AJvYcCXtkQQ0+3Thg+joH58MATPhePeGJ9UCtum5dwT2fa24neqlBAPt5v74oJdI7O6bvi0yUVrfhjIP+hpEryUg@vger.kernel.org X-Gm-Message-State: AOJu0YyPZaqlHnOVY5KPJwGUC/M4HE5WEJg5Q+zg9Rf1VJ3A7cRAD+nK 8till8zYcgO+vDm+Dn86dPDoAJAsGYGJxD4IiTFb4U1Z9eV5dKRX X-Gm-Gg: ASbGncsHkn7jachGf30liae271Zx643oHfh7HyXXzq5slg0/xQ2gSmX69MG11HxCLIX 2b1MLUGdMx/DW1jv1YJdan5K9UbR4jbQCXf/EP46LkGTzViTD758qfTYB0ZDUhzELFyULCn0BL/ UVXKPzVGzzaNPnIZJxiwOzR4xZnaunoALqzsIlTm0DXZCWVh2+NnkB2iR7Xb32YCL3DTnGE8UXz KlnB6YTzRg9R9CIdga7rQg8RWBR/gmMMhMNKMSHUgjQ/nt6pJOxSYycgPtaf+DjoA/kpv0U3I76 s7+AUsdcLw== X-Google-Smtp-Source: AGHT+IEEnvYznkH+51HQXrqFv74DFt9PIG/zZkxeCWgT0J7CgcyGwa6gKNTfyx1CPkQQHYQGT1UTFw== X-Received: by 2002:a5d:64ee:0:b0:385:fc00:f5f3 with SMTP id ffacd0b85a97d-38a872f7f8bmr13501284f8f.4.1736767443504; Mon, 13 Jan 2025 03:24:03 -0800 (PST) Received: from prasmi.Home ([2a06:5906:61b:2d00:acc9:404c:3a6c:d1aa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436f04df606sm107597115e9.12.2025.01.13.03.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 03:24:02 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Wim Van Sebroeck , Guenter Roeck , Magnus Damm , Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v3 5/6] watchdog: rzv2h_wdt: Add support to retrieve the bootstatus information Date: Mon, 13 Jan 2025 11:23:48 +0000 Message-ID: <20250113112349.801875-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113112349.801875-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250113112349.801875-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar On the RZ/V2H(P) SoC we can determine if the current boot is due to `Power-on-Reset` or due to the `Watchdog`. The information used to determine this is present on the CPG block. The CPG_ERROR_RSTm(m = 2 - 8) registers are set in response to an error interrupt causing an reset. CPG_ERROR_RST2[ERROR_RST0/1/2] is set if there was an underflow/overflow on WDT1 causing an error interrupt. To fetch this information from CPG block `syscon` is used and bootstatus field in the watchdog device is updated based on the CPG_ERROR_RST2[ERROR_RST0/1/2] bit. Upon consumig CPG_ERROR_RST2[ERROR_RST0/1/2] bit we clear it. Signed-off-by: Lad Prabhakar --- Note, this change doesnt break any ABI, if the `syscon` node is missing the driver probe continues further to handle backward compatibility. v2->v3 - No change v1->v2 - Returned ret in error path instead of -EINVAL - Dropped unnecessar regmap_read --- drivers/watchdog/rzv2h_wdt.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/watchdog/rzv2h_wdt.c b/drivers/watchdog/rzv2h_wdt.c index 8defd0241213..ab7e35928190 100644 --- a/drivers/watchdog/rzv2h_wdt.c +++ b/drivers/watchdog/rzv2h_wdt.c @@ -4,14 +4,17 @@ * * Copyright (C) 2024 Renesas Electronics Corporation. */ +#include #include #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -40,6 +43,9 @@ #define WDT_DEFAULT_TIMEOUT 60U +#define CPG_ERROR_RST2(x) BIT(x) +#define CPG_ERROR_RST2_WEN(x) BIT((x) + 16) + static bool nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, bool, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" @@ -206,9 +212,37 @@ static const struct watchdog_ops rzv2h_wdt_ops = { static int rzv2h_wdt_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; struct rzv2h_wdt_priv *priv; + unsigned int bootstatus = 0; + struct regmap *syscon; int ret; + /* Do not error out to maintain old DT compatibility */ + syscon = syscon_regmap_lookup_by_phandle(np, "renesas,syscon-cpg-error-rst"); + if (!IS_ERR(syscon)) { + struct of_phandle_args args; + u32 reg; + + ret = of_parse_phandle_with_fixed_args(np, "renesas,syscon-cpg-error-rst", + 2, 0, &args); + if (ret) + return ret; + + ret = regmap_read(syscon, args.args[0], ®); + if (ret) + return ret; + + if (reg & CPG_ERROR_RST2(args.args[1])) { + ret = regmap_write(syscon, args.args[0], + CPG_ERROR_RST2(args.args[1]) | + CPG_ERROR_RST2_WEN(args.args[1])); + if (ret) + return ret; + } + bootstatus = reg & CPG_ERROR_RST2(args.args[1]) ? WDIOF_CARDRESET : 0; + } + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; @@ -243,6 +277,7 @@ static int rzv2h_wdt_probe(struct platform_device *pdev) priv->wdev.info = &rzv2h_wdt_ident; priv->wdev.ops = &rzv2h_wdt_ops; priv->wdev.parent = dev; + priv->wdev.bootstatus = bootstatus; watchdog_set_drvdata(&priv->wdev, priv); watchdog_set_nowayout(&priv->wdev, nowayout); watchdog_stop_on_unregister(&priv->wdev);