linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Eddie James <eajames@linux.vnet.ibm.com>
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	joel@jms.id.au, wim@linux-watchdog.org,
	Milton Miller <miltonm@us.ibm.com>
Subject: Re: [PATCH 2/2] watchdog: aspeed: Allow configuring for alternate boot
Date: Fri, 16 Mar 2018 15:24:09 -0700	[thread overview]
Message-ID: <20180316222409.GA13278@roeck-us.net> (raw)
In-Reply-To: <bab2d3b4-536c-5dcb-4a13-95a29560d416@linux.vnet.ibm.com>

On Wed, Mar 14, 2018 at 02:53:13PM -0500, Eddie James wrote:
> 
> 
> 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 <miltonm@us.ibm.com>
> >>
> >>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 <miltonm@us.ibm.com>
> >>Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com>
> >This is already documented in the bindings document, so the property
> >should be ok.
> >
> >Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
> 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?
> 
If you have the means to determine that the watchdog timed out in the previous
boot, can you just set the WDIOF_CARDRESET status bit ?

Guenter

> 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
> >>
> 

  reply	other threads:[~2018-03-16 22:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 21:58 [PATCH 0/2] aspeed: watchdog: fix system reset and read alt-boot option Eddie James
2018-03-09 21:58 ` [PATCH 1/2] watchdog: aspeed: Fix translation of reset mode to ctrl register Eddie James
2018-03-09 22:03   ` Guenter Roeck
2018-03-09 21:58 ` [PATCH 2/2] watchdog: aspeed: Allow configuring for alternate boot Eddie James
2018-03-09 22:06   ` Guenter Roeck
2018-03-14 19:53     ` Eddie James
2018-03-16 22:24       ` Guenter Roeck [this message]
2018-03-13  4:29   ` Joel Stanley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180316222409.GA13278@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=eajames@linux.vnet.ibm.com \
    --cc=joel@jms.id.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=miltonm@us.ibm.com \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).