From patchwork Thu Nov 4 14:55:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1551060 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ZlUOPdhx; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=vDmJ7yWj; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HlRbw57fTz9sRN for ; Fri, 5 Nov 2021 01:58:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9LxthJYpQ3fDp6iIwVwMcHLRj5jgiqY4n2bxwLsNiMo=; b=ZlUOPdhxUjeb1+ S8jOYgzLQCPxH4FjB3yzRUyMfGSND+veuE4OXYUd5gIE+1y60pBARl1BRJvfr2ZJRhTHgOu55G244 OgM9oSV+FxQNMBM2y6WUKendMQpHVwSpavHgalnWrfdLvQCQiqkLilRpgUXpCz8jVM4K6PRVElbVo 4ktzAvoI5zrLTt8sC0VHRkxdx1zdlSKVkd4UfxC9ueU6wTDiSav7slmIc6HUpAFrK0blSvNaANMcf uTrkAsOW4mn3R1tr0hErQgGWivMKoohnBrRkcQqEohOk8M5Mg+29ThqCA2ysx/7p6Q5DK7WCjXdhs XDhxJjp+aAGn7FPZjkcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mieAJ-0099Kv-CJ; Thu, 04 Nov 2021 14:56:31 +0000 Received: from polaris.svanheule.net ([2a00:c98:2060:a004:1::200]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mie9p-0099By-QI for openwrt-devel@lists.openwrt.org; Thu, 04 Nov 2021 14:56:04 +0000 Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:eafe:c901:bf08:f0c1:3ec1:1bfc]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id C9E5826C425; Thu, 4 Nov 2021 15:55:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1636037757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xk/3TcQV1jwBb389GygcBKwQl0OjGFrO7neDHBlp9cI=; b=vDmJ7yWjsK6syaq6uTdxdu6tzWC7HdmiqfqKM0JPVGJyENL20sqeEJLnULGqaH2LwrtAhL FbVItKPTSgRYMtpZD8GgFtb37rid9v4fWzf8wyq00KtIFzd6v7aaJeLRAEVxrwrjQfhCMi 81SDNWmF4xSw+o+3BhbVPnq2C9U4Hk2J8tCCAv7MZqX4t6xYaLQWaiNL+tn2L9Ou1ypvXE 3ZwYa06abRK62qemne/CJo/IAgO3V1Ug+djaP0hoOcc+tx2JdNhRzxiOXgP7dk69K/elWY lltEoFlrflyY3Sjsqyn0WdfzDbp/HgvO1Zu+z/eRQf+CCKrPhlpOEk6f6c0Eww== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: Birger Koblitz , John Crispin , Sander Vanheule Subject: [PATCH 4/5] realtek: Add watchdog node Date: Thu, 4 Nov 2021 15:55:43 +0100 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211104_075602_056544_4D6B6628 X-CRM114-Status: GOOD ( 10.51 ) X-Spam-Score: -2.5 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add and enable the Realtek Otto WDT peripheral found on these SoCs. Devices that require the PLL value fixup before restarting, should pick the "cpu" or "software" reset mode. These devices also need to provide a custom reboot mode, by adding the reboot argument to th [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2a00:c98:2060:a004:1:0:0:200 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add and enable the Realtek Otto WDT peripheral found on these SoCs. Devices that require the PLL value fixup before restarting, should pick the "cpu" or "software" reset mode. These devices also need to provide a custom reboot mode, by adding the reboot argument to the kernel command line: WDT reset mode | kernel reboot mode ----------------+--------------------------------------- soc | reboot=cold (default if not specified) cpu | reboot=warm software | reboot=software Since RTL838x can only perform cold reboots reliably on selected devices, default this platform to use reboot=warm and "cpu" reset. RTL930x devices have more reliable reset logic, and can use the default (cold) reboot and "soc" resets. Note that watchdog restarts are not yet exposed, since the _machine_restart override is still present. Signed-off-by: Sander Vanheule --- target/linux/realtek/dts-5.10/rtl838x.dtsi | 16 +++++++++++++++- target/linux/realtek/dts-5.10/rtl930x.dtsi | 14 ++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/target/linux/realtek/dts-5.10/rtl838x.dtsi b/target/linux/realtek/dts-5.10/rtl838x.dtsi index 9aa646ed968e..9149a098666e 100644 --- a/target/linux/realtek/dts-5.10/rtl838x.dtsi +++ b/target/linux/realtek/dts-5.10/rtl838x.dtsi @@ -65,7 +65,7 @@ }; chosen { - bootargs = "console=ttyS0,115200"; + bootargs = "console=ttyS0,115200 reboot=warm"; }; lx_clk: lx_clk { @@ -153,6 +153,20 @@ status = "disabled"; }; + watchdog: watchdog@3150 { + compatible = "realtek,rtl8380-wdt"; + reg = <0x3150 0xc>; + + realtek,reset-mode = "cpu"; + + clocks = <&lx_clk>; + timeout-sec = <30>; + + interrupt-parent = <&intc>; + interrupt-names = "phase1", "phase2"; + interrupts = <19>, <18>; + }; + gpio0: gpio-controller@3500 { compatible = "realtek,rtl8380-gpio", "realtek,otto-gpio"; reg = <0x3500 0x20>; diff --git a/target/linux/realtek/dts-5.10/rtl930x.dtsi b/target/linux/realtek/dts-5.10/rtl930x.dtsi index e53f506a956f..a9b483c57338 100644 --- a/target/linux/realtek/dts-5.10/rtl930x.dtsi +++ b/target/linux/realtek/dts-5.10/rtl930x.dtsi @@ -162,6 +162,20 @@ status = "disabled"; }; + watchdog0: watchdog@3260 { + compatible = "realtek,rtl9300-wdt"; + reg = <0x3260 0xc>; + + realtek,reset-mode = "soc"; + + clock = <&osc 0>; + timeout-sec = <30>; + + interrupt-parent = <&intc>; + interrupt-names = "phase1", "phase2"; + interrupts = <5>, <6>; + }; + gpio0: gpio-controller@3500 { compatible = "realtek,rtl8380-gpio", "realtek,otto-gpio"; reg = <0x3500 0x20>;