Received: by 10.213.65.68 with SMTP id h4csp130420imn; Mon, 12 Mar 2018 21:31:04 -0700 (PDT) X-Google-Smtp-Source: AG47ELs84YAM0gj6ShYX96p2svf3KSBUlkTQGT2tJXKfaXIHioT+IZLRXzjpKb+rj4zPk0Imcwdt X-Received: by 10.99.112.92 with SMTP id a28mr2374026pgn.17.1520915464216; Mon, 12 Mar 2018 21:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520915464; cv=none; d=google.com; s=arc-20160816; b=SEuhXCUfpuU0m3OcL35cf5qTZjsNcuhgdGFLZKogtFvaGH0l28/V2GdkjEEepcHATr MCtchzp0dFmMXXVxGjVwrFIFOy9HjcXU7TeLboFKMdagYJHDkgNbsBXs1QysNQSgVqKu i8Uuih9oQnFgA3tkzEF+88jReyMJ7fywlcxG5IZvloFy9Fm0ZGkFcviV/dIDBlqtIQXC xYy3DX+kXn9Cmq1FYBrs88Ewxmc7zimihbm5FXp3pkzWlCPEzoDhJ9s7viHpQpObvlvu tQGB3ifqGcMdmO6Qw45L29Rlb+zpjBJlvDMK280IW231naEQUtNkN2/L+xoMX+fF0kT9 MRaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=qPcRpgxOhhrVxshbPle9fqzOyygIFK2zz3cj9DZ7nik=; b=pKXNEHSOHuPmg/WOzUjJXhFT0hZUA9q600sVyPV+hXkikp62pHbfmQFVwbzA9xt2Bg jsp/pHqO2jZYy3cjThp5Djgapc2bysPxNyji3+oKqswCIsoR3pO4jySK8JA7vc7ObeIM 9cxgEFYPyevPDYSXWKsrWS5eXQkiwuglU93t/ojM4KJF0VscUDcmbSsW0UJttqd5uo6m Zj7SdpWm+uzsj2DQMJGdOP8VbswB7Evswvnow+3fWjop3sKCTxb5Gv4pnBfcPhGR+rPj 8ijt+Z2n9oCXifkMGeoum86RNdu0iqpH5LajBN1pCnxpXtolA4HZ//2moDfeOn0BEis7 1+yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=t6v1bL3h; dkim=fail header.i=@jms.id.au header.s=google header.b=jRxuGS6Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si6963361pfb.394.2018.03.12.21.30.49; Mon, 12 Mar 2018 21:31:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=t6v1bL3h; dkim=fail header.i=@jms.id.au header.s=google header.b=jRxuGS6Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751616AbeCME3o (ORCPT + 99 others); Tue, 13 Mar 2018 00:29:44 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:40085 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751535AbeCME3l (ORCPT ); Tue, 13 Mar 2018 00:29:41 -0400 Received: by mail-qt0-f195.google.com with SMTP id y6so21373016qtm.7; Mon, 12 Mar 2018 21:29:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qPcRpgxOhhrVxshbPle9fqzOyygIFK2zz3cj9DZ7nik=; b=t6v1bL3htcBxEv3nTlLBMdCZRQfAkBTdkhjfzbThcxdQEkVGu197cwgU8KEmeP5tSZ U1gKyCaHope5HRtrpFNw0xpFUQu36ESUP+qbcODEb5+UHH/StzLsSa4L9IyQm6jcQwRi R1kclIKhgbhTCuTRkgSYCWO0MuBNnSQoX1Ywl/h8bJeNfIYhrEsf2LnZLtIClIUQHz/C 49DQVUMPcUO2KkqOvTwrgq5KBK4fo7kPwRchID8j/TWWX1EN7xYb1RS8UGI7XQaYxdv5 q89mjUcOXvm/dmMxNT7m1RrVwTybIzAOHry1bWQy3rX60G66QrN5lqgevqOm55732PEh m6hw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qPcRpgxOhhrVxshbPle9fqzOyygIFK2zz3cj9DZ7nik=; b=jRxuGS6Y8WLXhscsKB9JH6vkbM1Z9YTCEwjdX3P1wtO1TlveVyW6AjIK8BOkP0MuCy Y2XJDw1V95VvIFALe5P7597mdXX01XA90oLvgOPjqiTt7B2BrArACggDrX+f0qAdVoep B7+W7yxrEVpfbuNQi83MWa2mLCIjCwbhbT4vg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=qPcRpgxOhhrVxshbPle9fqzOyygIFK2zz3cj9DZ7nik=; b=Xwt++ZUxGFqOUyYDdmva1Nw2nv+sTs03XEvkkmsaYbl+XBsHAA62tcs7CCWjcZMUtu bHcUATWnabuyLNKqv0gCl1A4WZQd6Cr6kPuZCponQyHxcw9Ll75R4oBMW9aH4AxeNPzz K/IhZmZt1P2zErqrlYu8PoSF8HvZH098SGXUO/hqdJx+wqTA/5hF3Y3XioLk928JeQma Ejx0bMeN8LQbqNeSBIAHbNdMhy6RrtQPzKvfiw5VgLnyMH/pTJU32SD2Bg2wmNilZdXz jYw0QG4ch4E+aA4dx1WtziiEuUnHhpMwQbrNAe4IwisKR/SuPrgURVRFlSTyVm7vGdwN zL3w== X-Gm-Message-State: AElRT7E08C7LY0T7E+Nm6VnLrG2Y8B77wJZUaBd3K6pHAWmPbCeWznWx TFmVC+OvoRDMoargV9gNMQYlUonsvx+RQc2JXDE= X-Received: by 10.237.59.49 with SMTP id p46mr4485106qte.84.1520915380589; Mon, 12 Mar 2018 21:29:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.50.69 with HTTP; Mon, 12 Mar 2018 21:29:20 -0700 (PDT) In-Reply-To: <1520632700-25800-3-git-send-email-eajames@linux.vnet.ibm.com> References: <1520632700-25800-1-git-send-email-eajames@linux.vnet.ibm.com> <1520632700-25800-3-git-send-email-eajames@linux.vnet.ibm.com> From: Joel Stanley Date: Tue, 13 Mar 2018 14:59:20 +1030 X-Google-Sender-Auth: FkSOmnoFUFv5iXIUQVRa4osYvqo Message-ID: Subject: Re: [PATCH 2/2] watchdog: aspeed: Allow configuring for alternate boot To: Eddie James Cc: LINUXWATCHDOG , Linux Kernel Mailing List , Wim Van Sebroeck , Guenter Roeck , Milton Miller , Andrew Jeffery Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 10, 2018 at 8:28 AM, Eddie James wrote: > From: Milton Miller > > Allow the device tree to specify a watchdog to fallover to > the alternate boot source. > > The aspeeed watchdog can set a latch directing flash chip select 0 to > chip select 1, allowing boot from an alternate media if the watchdog > is not reset in time. On the ast2400 bank 1 also goes to flash bank 1, > while on the ast2500 the chip selects are swapped. > > Signed-off-by: Milton Miller > Signed-off-by: Eddie James > --- > drivers/watchdog/aspeed_wdt.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c > index d1987d6..f41d246 100644 > --- a/drivers/watchdog/aspeed_wdt.c > +++ b/drivers/watchdog/aspeed_wdt.c > @@ -46,6 +46,7 @@ struct aspeed_wdt_config { > #define WDT_RELOAD_VALUE 0x04 > #define WDT_RESTART 0x08 > #define WDT_CTRL 0x0C > +#define WDT_CTRL_BOOT_SECONDARY BIT(7) > #define WDT_CTRL_RESET_MODE_SOC (0x00 << 5) > #define WDT_CTRL_RESET_MODE_FULL_CHIP (0x01 << 5) > #define WDT_CTRL_RESET_MODE_ARM_CPU (0x10 << 5) > @@ -245,6 +246,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev) > } > if (of_property_read_bool(np, "aspeed,external-signal")) > wdt->ctrl |= WDT_CTRL_WDT_EXT; > + if (of_property_read_bool(np, "aspeed,alt-boot")) > + wdt->ctrl |= WDT_CTRL_BOOT_SECONDARY; If a user sets this property on the only watchdog in the system, then they will trigger this behaviour when doing a normal 'reboot'. That would not be desirable. We could mitigate this by: - not registering the watchdog as a reboot device if this property is enabled - clearing the WDT_CTRL_BOOT_SECONDARY bit in the aspeed_wdt_restart path The second option is neater as it allows the watchdog to behave normally when only one is enabled. The first would be confusing if a system didn't have more than one watchdog enabled. Cheers, Joel