Received: by 10.213.65.68 with SMTP id h4csp44909imn; Thu, 15 Mar 2018 09:04:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELsHgZH9+Nmz7LbVjxlPtA5SeYsDznYmHMMxyx5tRAXELkq+THn7noKEirjZd2qMkcBcyitG X-Received: by 2002:a17:902:aa91:: with SMTP id d17-v6mr8789707plr.145.1521129872315; Thu, 15 Mar 2018 09:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521129872; cv=none; d=google.com; s=arc-20160816; b=u7NFTAxiasFawPtXSrPdssW/zr/8MwxnIYiUL33hh9abWZiwEaGfQUQP7pqNxc7A9a Z3io2J/d3mpzt+Uj9ANFMkvAUktzQP4KP1nV/3DoiYfSOTYCQrTfW73y6X1ZKvyLgzJ1 QHoRIdiXBmtHk5oqH0mSo6oAJj1Wgu6C9STd1GYj4WDfhc56JQ4FImkrHaiWqobK9CtS tu96I+OWMnDeEH4hvfDjbzPWmhD12BqcJB0MTXBYzBcTaDkRUoAKNCYMDa0AZyBreFIg /bBTHzQ9mDqn5Ocit3wbCtrAGshqG6mwRjVLjqlCpa/FejoKhnlrTZBkONb5BmEOi79t tWbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=7rcx2+xE3uwSAKwkDjPpNkca78RWZFsVtSMz8+AYl7E=; b=nA8CH6sytcs9sFyVXElyBp6okZsJ+5+nTwB2YdqHV6w4XDXHSpbYOt2ZAMFnhWmF+u 2O6B+KwtaNdDcjpopC8xrdqlxTGgh41D0NoL9F2gSqIRrfGl0463UaQSzhAzEU5vUJGw lOE2mi9Eiiqzu1fzESCXKXAjh+EXj5FWooMNl3lq1687NIDwF4xUEE5ZYlc2l2AZ2z9y j2xmDNsV0GevQSUsiAsl4lV743FW81MPkOkSrKGOKiK6xRQ7Og5RbSGzuIxfUrUedjka Xr7AK+disC86M6HzSbU7VnkUT0udM0LuvyMevscSnmrV30JJfu1KRd+PXF8hGYPrsygt 1qFA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b59-v6si4190516plc.309.2018.03.15.09.04.15; Thu, 15 Mar 2018 09:04:32 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933141AbeCOQCS (ORCPT + 99 others); Thu, 15 Mar 2018 12:02:18 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:35948 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932475AbeCOQCP (ORCPT ); Thu, 15 Mar 2018 12:02:15 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2FG0hDm073793 for ; Thu, 15 Mar 2018 12:02:14 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gqu48u90y-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 15 Mar 2018 12:02:14 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Mar 2018 10:02:12 -0600 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Mar 2018 10:02:10 -0600 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2FG2AoQ14025070; Thu, 15 Mar 2018 09:02:10 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E2E74C604F; Thu, 15 Mar 2018 10:02:09 -0600 (MDT) Received: from talon7.ibm.com (unknown [9.85.207.235]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id D6FEAC6037; Thu, 15 Mar 2018 10:02:08 -0600 (MDT) From: Eddie James To: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org, joel@jms.id.au, wim@linux-watchdog.org, linux@roeck-us.net, Milton Miller , Eddie James Subject: [PATCH v2] watchdog: aspeed: Allow configuring for alternate boot Date: Thu, 15 Mar 2018 11:02:06 -0500 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 18031516-0004-0000-0000-000013CE73CC X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008679; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01003457; UDB=6.00510682; IPR=6.00782783; MB=3.00020051; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-15 16:02:11 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031516-0005-0000-0000-00008679C508 Message-Id: <1521129726-15490-1-git-send-email-eajames@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-15_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803150176 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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