Received: by 10.213.65.68 with SMTP id h4csp1207287imn; Wed, 14 Mar 2018 12:54:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELu8Zazs3c+eKfyleF8eyuRscs7LkDMDipCsmyIs3SX0+kWH180+N92ibc/mfsQlriv5PL1F X-Received: by 2002:a17:902:8214:: with SMTP id x20-v6mr5274175pln.182.1521057271097; Wed, 14 Mar 2018 12:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521057271; cv=none; d=google.com; s=arc-20160816; b=Mts5WGu2K69ABlwySwb1mi07CkCfOB+Qg3noup1VMVeWjMsj2jTy4oJFoPCAGhh0lQ 3onfuzV01baNwFuiU6a2jda24Bw870SEV9UrnPq1LzwbWU5tZau/OYcGACqdZ+XVjXxs u4wlJ98U+bpfwH9KNu34tNR8A/mTDGw9BYMhernfXN1VtbFzIp/NphxrBNr8aLGFsWbF YoCj4C3iubNmnrIK4PS1SN94DSHUxL5tl2r0JcQd1m7DHt+03C1M8Tf8XHV1jyzCGsGA vTDOgOniPAQYsAv/yhmO/sKVi7aoEVZf285hMZlrRaENntWaxznm9IshZJypJuTHbogp sjxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:arc-authentication-results; bh=+mM2nB9W/SgAslNpazfb1DxnEL+aHjWvHfYC26Im//c=; b=YKZXqjpLt6OXaefGn9P1dBotYoVZUJz7U3cEoNR4Pmu///h8tLq2g8SC0+OPvfat5Y SVH7xX1cYjrlKMubUcc+7J3YwOso8xR413FUOJPFXTuLl3RXadlBfZHLCiuK1a6uolZe rdKxYM99EYtqcP2G7ESTTc37DhclkOZUcrK19GfxuHZ6v7jEBrO6/u6uAvSqGIh0Z8RA wxuvU4fP0X0vqFKkDQmTIOlcvhFAVLVnk0vpNBTg/6SOPB5Zps3Sw/GXJJan99WlZCTO Xw/iutw6XJQVFppNIxdIBUD3kobMp69JIUEVcUGNk1YftnT54tYaHy8/4DXf8edrgrEP sPkg== 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 f34-v6si2466302ple.330.2018.03.14.12.54.15; Wed, 14 Mar 2018 12:54:31 -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 S1751461AbeCNTxV (ORCPT + 99 others); Wed, 14 Mar 2018 15:53:21 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59086 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289AbeCNTxT (ORCPT ); Wed, 14 Mar 2018 15:53:19 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2EJnJ7S137859 for ; Wed, 14 Mar 2018 15:53:19 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gq5c6nrkp-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 14 Mar 2018 15:53:18 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 14 Mar 2018 13:53:18 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 14 Mar 2018 13:53:15 -0600 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2EJrEEH12124568; Wed, 14 Mar 2018 12:53:14 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AF9A9C604A; Wed, 14 Mar 2018 13:53:14 -0600 (MDT) Received: from [9.41.241.240] (unknown [9.41.241.240]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id 2ED05C6042; Wed, 14 Mar 2018 13:53:14 -0600 (MDT) Subject: Re: [PATCH 2/2] watchdog: aspeed: Allow configuring for alternate boot To: Guenter Roeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, joel@jms.id.au, wim@linux-watchdog.org, Milton Miller References: <1520632700-25800-1-git-send-email-eajames@linux.vnet.ibm.com> <1520632700-25800-3-git-send-email-eajames@linux.vnet.ibm.com> <20180309220610.GB32606@roeck-us.net> From: Eddie James Date: Wed, 14 Mar 2018 14:53:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180309220610.GB32606@roeck-us.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18031419-0004-0000-0000-000013CD68A8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008674; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.01003054; UDB=6.00510441; IPR=6.00782384; MB=3.00020035; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-14 19:53:17 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031419-0005-0000-0000-00008676D904 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-14_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1803140214 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/09/2018 04:06 PM, Guenter Roeck wrote: > On Fri, Mar 09, 2018 at 03:58:20PM -0600, 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 > This is already documented in the bindings document, so the property > should be ok. > > Reviewed-by: Guenter Roeck Thanks. On a related note, our system has need of a way to determine if it's currently booted from the alternate chip or not. It seems the only way to tell is to look at the ast2400/2500 watchdog timeout status register. We can add some debugfs to the aspeed driver I guess, but I wonder if this is a common enough situation that the watchdog core could use some debugfs or sysfs for providing that info? Thanks, Eddie > >> --- >> 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 (readl(wdt->base + WDT_CTRL) & WDT_CTRL_ENABLE) { >> /* >> -- >> 1.8.3.1 >>