Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5169691rwp; Sun, 16 Jul 2023 21:53:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlE4PzepUI1iKRLq0s5CgS7m8nsl3XwiaEQk70F5QDl7+ICAcsrqz2Fxnsdnseb16ZB4Gcux X-Received: by 2002:a05:6402:40d1:b0:521:71ef:996f with SMTP id z17-20020a05640240d100b0052171ef996fmr6074084edb.1.1689569605990; Sun, 16 Jul 2023 21:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689569605; cv=none; d=google.com; s=arc-20160816; b=iXfZ+zza9Tav5ycGp4C2/ulgV8YDgfoc7pyjZ1Ycny3fmJkSOlJgKN9rL50CzM5Zvg brThfNlQxwVp/8P+w3lHGK0r/OCcoDTW3eBDuXh04t0avhC2Cuehpw1wqyBXjp3pK89X K9aoA6GlkpjUsu1ApPEgwawmMqMhVTZyDgNZjX1RnegH24sApPBEeOR1yPhGtwyVWTAr HzYXlkYDkD+aijAi67f4gJ2H68NFlYIIQzTRuRffFsl9zOg/B9E6SW6biAwt3uR6Z2SN 80Bu7ueXSaqSpx9RZv6XdOOktSEmBrbUp03A+9fZgMHQg+O3urLHVAD8nHiZeNIDKRu6 ZUSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Nj21lCdl8nb8wOaJjf94cou6OITTnAi/oVfGe4ko348=; fh=Vv2NU0o8lI9D50+eW6uQioASqX2WRvzARAkK+S3xLAY=; b=qzVhXutaVKQg/kGq8TJijj+h4D+/DMpxIW0WksPAiGhXpLjY6eck+fe/+Fq5CaYmvA UTsGnF7vcjzxVyaxzQj6y4LIOys75tn0zAEdWAG+3sKn71fJ37TCEsgWr3ofC5lGtV+E O3gY0COHV0Ajzc/viaYlIjv5Ze6lRaiA8LyEuhAO9l3NK5pbmFwt9mX19eTCAnqeylfR TG9Nhl1r5CSizF2ZjOgnoLaw8HD/CPi0J6WyBVKOJ6faQ+yeMPGMoEElvY3cSwsQ+vQu 41sbTygPbhDDkv6YudHJ74WyZJ7wvcE+XxlA5nC9I+scJdrg74qFfbxrWpVE/EfeAQQ4 A7bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=eoZV0bRP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o24-20020aa7c518000000b0051dd2b751ebsi12861688edq.650.2023.07.16.21.52.59; Sun, 16 Jul 2023 21:53:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=eoZV0bRP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbjGQEJB (ORCPT + 99 others); Mon, 17 Jul 2023 00:09:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230264AbjGQEIz (ORCPT ); Mon, 17 Jul 2023 00:08:55 -0400 X-Greylist: delayed 61 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 16 Jul 2023 21:08:53 PDT Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net [185.136.65.226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9E9D1AA for ; Sun, 16 Jul 2023 21:08:53 -0700 (PDT) Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20230717040750349f0ba14327c31c9c for ; Mon, 17 Jul 2023 06:07:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=huaqian.li@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=Nj21lCdl8nb8wOaJjf94cou6OITTnAi/oVfGe4ko348=; b=eoZV0bRPzryisQa4vKAPfKQvEID9x2QvXYRc8XBGVtHruXc7Uq7All8KaSBDcNj+cPpUfn kMA7oQe4XRThHLUOU742XfDWuLRnQfvqeZNrfqCSR74e9oLnlvsnifXl0nrOzY3kwMGA0gED 1FhezfXzv8C962zXJlcKyPKTmnc1A=; From: huaqian.li@siemens.com To: wim@linux-watchdog.org, linux@roeck-us.net, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: huaqianlee@gmail.com, nm@ti.com, vigneshr@ti.com, kristo@kernel.org, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jan.kiszka@siemens.com, baocheng.su@siemens.com, Li Hua Qian , Krzysztof Kozlowski , Conor Dooley , Rob Herring Subject: [PATCH v4 1/3] dt-bindings: watchdog: ti,rti-wdt: Add support for WDIOF_CARDRESET Date: Mon, 17 Jul 2023 12:07:21 +0800 Message-Id: <20230717040723.1306374-2-huaqian.li@siemens.com> In-Reply-To: <20230717040723.1306374-1-huaqian.li@siemens.com> References: <20230717040723.1306374-1-huaqian.li@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-959203:519-21489:flowmailer X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Li Hua Qian TI RTI (Real Time Interrupt) Watchdog doesn't support to record the watchdog cause. Add a reserved memory to know the last reboot was caused by the watchdog card. In the reserved memory, some specific info will be saved to indicate whether the watchdog reset was triggered in last boot. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Reviewed-by: Rob Herring Signed-off-by: Li Hua Qian --- .../bindings/watchdog/ti,rti-wdt.yaml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Documentation/devicetree/bindings/watchdog/ti,rti-wdt.yaml b/Documentation/devicetree/bindings/watchdog/ti,rti-wdt.yaml index fc553211e42d..4b66c4fcdf35 100644 --- a/Documentation/devicetree/bindings/watchdog/ti,rti-wdt.yaml +++ b/Documentation/devicetree/bindings/watchdog/ti,rti-wdt.yaml @@ -34,6 +34,20 @@ properties: power-domains: maxItems: 1 + memory-region: + maxItems: 1 + description: + Contains the watchdog reserved memory. It is optional. + In the reserved memory, the specified values, which are + PON_REASON_SOF_NUM(0xBBBBCCCC), PON_REASON_MAGIC_NUM(0xDDDDDDDD), + and PON_REASON_EOF_NUM(0xCCCCBBBB), are pre-stored at the first + 3 * 4 bytes to tell that last boot was caused by watchdog reset. + Once the PON reason is captured by driver(rti_wdt.c), the driver + is supposed to wipe the whole memory region. Surely, if this + property is set, at least 12 bytes reserved memory starting from + specific memory address(0xa220000) should be set. More please + refer to Example 2. + required: - compatible - reg @@ -59,3 +73,30 @@ examples: assigned-clocks = <&k3_clks 252 1>; assigned-clock-parents = <&k3_clks 252 5>; }; + + - | + // Example 2 (Add reserved memory for watchdog reset cause): + /* + * RTI WDT in main domain on J721e SoC. Assigned clocks are used to + * select the source clock for the watchdog, forcing it to tick with + * a 32kHz clock in this case. Add a reserved memory to keep the + * watchdog reset cause persistent, which was be written in 12 bytes + * starting from 0xa2200000 by RTI Watchdog Firmware. + * + * Reserved memory should be defined as follows: + * reserved-memory { + * wdt_reset_memory_region: wdt-memory@a2200000 { + * reg = <0x00 0xa2200000 0x00 0x1000>; + * no-map; + * }; + * } + */ + watchdog@40610000 { + compatible = "ti,j7-rti-wdt"; + reg = <0x40610000 0x100>; + clocks = <&k3_clks 135 1>; + power-domains = <&k3_pds 135 TI_SCI_PD_EXCLUSIVE>; + assigned-clocks = <&k3_clks 135 0>; + assigned-clock-parents = <&k3_clks 135 4>; + memory-region = <&wdt_reset_memory_region>; + }; -- 2.34.1