Received: by 10.213.65.68 with SMTP id h4csp173575imn; Thu, 15 Mar 2018 22:20:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELv3XeFmuxJXme9RYIhkh0yu+ZXk+nrsdvPN2BJpB9Zh0qYvj0hqYztiXZsabEJQOqjA/ysx X-Received: by 10.98.227.10 with SMTP id g10mr471543pfh.200.1521177658746; Thu, 15 Mar 2018 22:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521177658; cv=none; d=google.com; s=arc-20160816; b=bSn7ykp+5Q8xcyTaVtlSnC+/Q1wnVANreKWuZ0DZRFOMwtjLgj7WpZmzZsZPky3Vy2 yQtRprfGOaMlpN+OZHj6aSBpTSQWBCL1dxCUpmc3/MPFDongHSnCJ7tQNUixmWVslX0m LyJic0RuzFaeshkodCN6epi8fb08HpD8WPusYyqCBHOrvxvc7WKfikkgoewg/GAHz9oN 2362MZefajHCW1YhB/mE1yWK+gJAZD8rKqEaEi1Yl6We8xm5uJbtQxUYRc2v/mCxpa+m H2CYSKn47pIfImPe2EqlxNsjHcnJNGQG48G0HZ39ahEAkDxVEjVcYevH28wfj874W2hn u0xA== 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=xT4ulQhvA1eyseZC94TX6bXl+WySZx1yTjK0cjkqkCU=; b=YjUe0WK0wliQRMheV0T0eekOWgi+tgya74cxVuQxhTFhhSg/hsHH4tsaQtds+eOq6O /sPIAaGV70dNecuXyGR3wCkT5hcTe0gMjMHuUDWSCE7HfZ9VawjvODix83DVzOzVXKD5 RmBowXfvEOVP9vGOYIfwJ3abIWV6kV9IkNrvHRWGB5/cO+OVnB6darkx0gYfHWsTI+jI N/93hSCrucVOB/up12ZlK6y7LyJeTWUTixBg3dj+bOV1oROUR9Gm3rmOejH46fyLsmFe CUcpTpbYYcQ/s4WG75kK1M9g9C72+69mTHJJV7X9llLxgx/W8Fn40LTx/VY5eNIEml0G qccQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=U00BXred; dkim=fail header.i=@jms.id.au header.s=google header.b=Ljt0Qjea; 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 m13si5009980pfk.26.2018.03.15.22.20.44; Thu, 15 Mar 2018 22:20:58 -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=U00BXred; dkim=fail header.i=@jms.id.au header.s=google header.b=Ljt0Qjea; 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 S1752348AbeCPFSy (ORCPT + 99 others); Fri, 16 Mar 2018 01:18:54 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:35831 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750877AbeCPFSw (ORCPT ); Fri, 16 Mar 2018 01:18:52 -0400 Received: by mail-qt0-f194.google.com with SMTP id z14so9736484qti.2; Thu, 15 Mar 2018 22:18:52 -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=xT4ulQhvA1eyseZC94TX6bXl+WySZx1yTjK0cjkqkCU=; b=U00BXredvu27hhCf0OKKDdFhdm8QJOO1O7T5n+YCvbtzrWqfj/LOijFXiw3c1J5x2Y eT7DMhrKIrlG+MiUsErbVLNqJj0CWVsTDGhEXmVPHE5iWHaW648FBY++oalUtGkXb9yy rN4jTOO+cjjcMYUOPWZ3iZayXl8AA57nqVbSQ06Jlj/PvO63gCcy21Bzczd3Y6yRT1Fb tF9N786WcXNIh4AMGDCmp6ljeyrg6TYBl+McBUdCFPnLbMLi+k1uZGV4WV1sTOgWhMVb nBC6aJUUFTBFYTlzyeIbO2SqtDmu84U98Xce/58IyZeEL4aQfkRVBre3YqG2BCU3OsUL 8hSw== 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=xT4ulQhvA1eyseZC94TX6bXl+WySZx1yTjK0cjkqkCU=; b=Ljt0QjeaOzUjbAPuwKuNivY2xFJa/YFONfj2xMiP1UJeogDLbmz0q78v+l4fCmdwWm wO+JuHMinWGDzxtM/Ux421VU0km/LH5v6h4tIdNJeUCIZa3VVn3mLOK94oyCi0LJmEUq kW0h/ECU7jdmW+/0cnnmxcMgdIXGvFk1JStxg= 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=xT4ulQhvA1eyseZC94TX6bXl+WySZx1yTjK0cjkqkCU=; b=pqVfbu/Lb30Q0HMVJ4cqQyz+eYKW7eSRC6vPI+RjJFMVbvBgirqMeWn5oWU5cgIyQT 9337voQ6LwJVZ4SpYDavfJLGdPTOewbIQ9ZruAxUcrcK7izM2ndj0VpYRmLxbvVD+bkC YH2Y7n5ngbZHYBvXxd+wJeeGx+zu+G2JcbGDQLWSaQrK8EYimz922vO3sT2unP24wy3j N6IKYhdHNEksXQI/kYPuJZxRUODSkrCtlkHZ93iwat/eVyERUTd8IwNKXhkpOYpqpfL3 WKoK1DfDMmEt14yE2dLjjbYyu5SmA2amRD9fBtsjNUrJOHnMIdvr+r6Kc7TX1rpogN5U E3gw== X-Gm-Message-State: AElRT7FCXH0HYWXx0wON4Ox6B2xt6TzIYcZqFy+D6nwQYXn8+oLXLFqA Qa6FgcOOoG6O5P+Z3Rh94X73+KdYSbCkpPany0xkpA== X-Received: by 10.200.53.164 with SMTP id k33mr710689qtb.37.1521177531556; Thu, 15 Mar 2018 22:18:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.63.197 with HTTP; Thu, 15 Mar 2018 22:18:31 -0700 (PDT) In-Reply-To: <1521129726-15490-1-git-send-email-eajames@linux.vnet.ibm.com> References: <1521129726-15490-1-git-send-email-eajames@linux.vnet.ibm.com> From: Joel Stanley Date: Fri, 16 Mar 2018 15:48:31 +1030 X-Google-Sender-Auth: a4SwiW8TpmOysxL9ieSAUuKiRGA Message-ID: Subject: Re: [PATCH v2] watchdog: aspeed: Allow configuring for alternate boot To: Eddie James Cc: LINUXWATCHDOG , Linux Kernel Mailing List , Wim Van Sebroeck , Guenter Roeck , Milton Miller 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 Fri, Mar 16, 2018 at 2:32 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. > > Also clear the secondary boot bit during the machine restart operation. > Otherwise, the system will switch to the alternate boot after every > reboot, which is not desired. > > Signed-off-by: Milton Miller > Signed-off-by: Eddie James That will do. Reviewed-by: Joel Stanley Cheers, Joel > --- > Changes since v1: > * Disable secondary boot before the restart operation. > > drivers/watchdog/aspeed_wdt.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c > index d1987d6..a5b8eb2 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) > @@ -158,6 +159,7 @@ static int aspeed_wdt_restart(struct watchdog_device *wdd, > { > struct aspeed_wdt *wdt = to_aspeed_wdt(wdd); > > + wdt->ctrl &= ~WDT_CTRL_BOOT_SECONDARY; > aspeed_wdt_enable(wdt, 128 * WDT_RATE_1MHZ / 1000); > > mdelay(1000); > @@ -245,6 +247,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 (readl(wdt->base + WDT_CTRL) & WDT_CTRL_ENABLE) { > /* > -- > 1.8.3.1 >