Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73D39C433EF for ; Fri, 12 Nov 2021 16:31:50 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D16E16054E for ; Fri, 12 Nov 2021 16:31:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D16E16054E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E71D82FCD; Fri, 12 Nov 2021 17:31:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="Blp0Ge+f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8704A82F71; Fri, 12 Nov 2021 17:31:45 +0100 (CET) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D1D8682F71 for ; Fri, 12 Nov 2021 17:31:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x72b.google.com with SMTP id t6so2429035qkg.1 for ; Fri, 12 Nov 2021 08:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZLpcZ7vdJZIjgQpQyVPgAYg5ihZFAtzSR1qZYp1vOyc=; b=Blp0Ge+fTeh9llqQTOpJPIYC4aK8NgXZV9GCEUHvJ9qCwHv21RCHgzzXOke9Rm0Cus MHUHBvtHYqt7iWeYj0L8qLnUtzx2IdxiC+THc1xSuuO+PhMHxAk78KIiQMU6o6Jlwpwi d2PVVX8UXE8iu5ROpPB4opAMOEkB3WrOibXJY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZLpcZ7vdJZIjgQpQyVPgAYg5ihZFAtzSR1qZYp1vOyc=; b=cfgz5MNYd29ob47GjwaD7lMitPw4zcNUuZscuJ9MPW4n9uEK43kWNP6YXiqjyPRH4C 8MeB8S8rdSuJ9CSnTmBnl3q2aRf0fEJPffD65MgeOJv4/WF0AdnOy6Jnyetqy/NyOjcc KiH7Q/Xnha1GAkUOKalz/LVZXKLvRmrtXbHcLl8u+2OEUhJDeAa9oO/ngQkL+jft4R0E 5GZwmfSkQTJiAAEB6s0VMBZhV6liktyjrJ8/TEGhtA41dITXZz8QN4+9qv0qYjzCy70M iidOxseF7mKwvNCtdcxoeV52wfTQwC5mh0AAEg6KK9q7dM+/4RIgr+EF14wxAuVIxhui o+NQ== X-Gm-Message-State: AOAM530TMScgrFrCRc2xPvYtQZMxdHVYZNkOFsaumETTaio1xANFW1gy 99Pk2RugCghzXgqUS2xeR7lZug== X-Google-Smtp-Source: ABdhPJynCMtYOnkGXxjt4fj+3wi74daITUm0pazj4v+KS5hCBs1kGXZ5c/hMEblmqE0LrFq/SVwoGg== X-Received: by 2002:a37:44d7:: with SMTP id r206mr13362153qka.421.1636734700665; Fri, 12 Nov 2021 08:31:40 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-99df-60fa-a7c9-fbd2.res6.spectrum.com. [2603:6081:7b01:cbda:99df:60fa:a7c9:fbd2]) by smtp.gmail.com with ESMTPSA id bm35sm1959123qkb.86.2021.11.12.08.31.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 08:31:39 -0800 (PST) Date: Fri, 12 Nov 2021 11:31:38 -0500 From: Tom Rini To: Stefan Roese Cc: Marek =?iso-8859-1?Q?Beh=FAn?= , u-boot@lists.denx.de, Pali =?iso-8859-1?Q?Roh=E1r?= , Marek =?iso-8859-1?Q?Beh=FAn?= Subject: Re: [PATCH u-boot-marvell] arm: mvebu: turris_omnia: enable A385 watchdog before disabling MCU watchdog Message-ID: <20211112163138.GY24579@bill-the-cat> References: <20211109161402.23111-1-kabel@kernel.org> <89b3be1b-21f7-f260-43e3-40daeec3b89d@denx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MvjEjs9xyVvypSOG" Content-Disposition: inline In-Reply-To: <89b3be1b-21f7-f260-43e3-40daeec3b89d@denx.de> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.35 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --MvjEjs9xyVvypSOG Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 12, 2021 at 02:44:15PM +0100, Stefan Roese wrote: > On 11/9/21 17:14, Marek Beh=FAn wrote: > > From: Pali Roh=E1r > >=20 > > Commit aeb0ca64dbb5 ("arm: mvebu: turris_omnia: disable MCU watchdog in > > SPL when booting over UART") disabled MCU watchdog when booting over > > UART to ensure that watchdog does not reboot the board before UART > > transfer finishes. > >=20 > > But if UART transfer fails for some reason, or if U-Boot binary crashes, > > then board hangs forever as there is no watchdog running which could > > reset it. > >=20 > > To fix this issue, enable A385 watchdog with very high timeout before > > disabling MCU watchdog to ensure that even slow transfer can finish > > successfully before watchdog timer expires and also to ensure that if > > board hangs for some reason, watchdog will reset it. > >=20 > > Omnia's MCU watchdog has fixed 120 seconds timer and it cannot be > > changed (without updating MCU firmware). A385 watchdog by default uses > > 25 MHz input clock and so the largest timeout value (2^32-1) can be > > just 171 seconds. But A385 watchdog can be switched to use NBCLK (L2) as > > input clock (on Turris Omnia it is 800 MHz clock) and in this case final > > watchdog clock frequency is calculated as: > >=20 > > freq =3D NBCLK / 2 / (2 ^ R) > >=20 > > So A385 watchdog on Turris Omnia can be configured to at most 1374 > > seconds (about 22 minutes). We set it to 10 minutes, which should be > > enough even for bigger U-Boot binaries or slower UART transfers. > >=20 > > Both U-Boot and Linux kernel, when initializing A385 watchdog, switch > > watchdog timer to 25 MHz input clock, so usage of NBCLK input clock in > > U-Boot SPL does not cause any issues. > >=20 > > Fixes: aeb0ca64dbb5 ("arm: mvebu: turris_omnia: disable MCU watchdog in= SPL when booting over UART") > > Signed-off-by: Pali Roh=E1r > > Signed-off-by: Marek Beh=FAn >=20 > I'm wondering if it makes sense to add this "slow" watchdog support to > the common watchdog driver instead (orion_wdt.c). So that it dynamically > configures the needed input clock for the desired timeout. >=20 > Would this be possible? I know I'm late to the thread here, but why can't / aren't we servicing the 120s watchdog during UART loading? Or have I gone crazy and we don't do that on say OMAP? --=20 Tom --MvjEjs9xyVvypSOG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmGOluYACgkQFHw5/5Y0 tyw6ZgwAqdF+egm83aVg0AAtkzDJFxhznoHOstwiyWUJvWayruSMl5f3QOAbifRF H6eYr5m/oltyiin68mtu3P862DKahsKtwh5XLgnTGloBLehw3EVH3nJttwJ1XMlg zEHHs16VzIsvDE9kra4fBNq0rSu7lyGUfaXm5UjmGxn1HX1aHEAnVfgjf7DuuF7g EGkTpIgooIgBpR+TCBEsI3HnFn1ClKGa1PlhI6oLBEJ/hfE43O2pBoQIuZYAcfzD m0BToq1DOqI3aFPW+6Hqte6atw0G4qLshFG/KmghvXet/PXnBRaB1FbuOKpICxnL KKhFzDa5bNZPdzwKfsiuQIXbktQCNsHki4TTRUN4noq47eoaStuDwPbvbsRWeQWu LjARc8+YMxDX5AohZjw/KlVDPXMFBCPUw8xlVEFUPA3VTnNMfcsRpKmVaVwSq7uz EtNB7Mvbhqve6cgnzS+7ghFtlOLBCscO2w9tkOzkltivQkK/x3JRYWXLgcky0LoK 0Lb+Grt3 =q8QM -----END PGP SIGNATURE----- --MvjEjs9xyVvypSOG--