From: Guenter Roeck <linux@roeck-us.net>
To: Jan Kiszka <jan.kiszka@siemens.com>, linux-watchdog@vger.kernel.org
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
linux-kernel@vger.kernel.org, "Awan,
Arsalan" <Arsalan_Awan@mentor.com>,
"Hombourger, Cedric" <Cedric_Hombourger@mentor.com>,
"Farnsworth, Wade" <wade_farnsworth@mentor.com>
Subject: Re: watchdog: sp5100_tco support for AMD V/R/E series
Date: Mon, 7 Sep 2020 08:31:51 -0700 [thread overview]
Message-ID: <f7e3233b-97e4-1f25-e18e-edb39ca86ce9@roeck-us.net> (raw)
In-Reply-To: <15c8913e-9026-2649-9911-71d6f1c79519@siemens.com>
On 9/7/20 4:20 AM, Jan Kiszka wrote:
> Hi all,
>
> Arsalan reported that the upstream driver for sp5100_tco does not work
> for embedded Ryzen. Meanwhile, I was able to confirm that on an R1505G:
>
> [ 11.607251] sp5100_tco: SP5100/SB800 TCO WatchDog Timer Driver
> [ 11.607337] sp5100-tco sp5100-tco: Using 0xfed80b00 for watchdog MMIO address
> [ 11.607344] sp5100-tco sp5100-tco: Watchdog hardware is disabled
>
> ..and fix it:
>
> diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c
> index 85e9664318c9..5482154fde42 100644
> --- a/drivers/watchdog/sp5100_tco.c
> +++ b/drivers/watchdog/sp5100_tco.c
> @@ -193,7 +193,8 @@ static void tco_timer_enable(struct sp5100_tco *tco)
> /* Set the Watchdog timer resolution to 1 sec and enable */
> sp5100_tco_update_pm_reg8(EFCH_PM_DECODEEN3,
> ~EFCH_PM_WATCHDOG_DISABLE,
> - EFCH_PM_DECODEEN_SECOND_RES);
> + EFCH_PM_DECODEEN_SECOND_RES |
> + EFCH_PM_DECODEEN_WDT_TMREN);
Confusing. The register in question is a 32-bit register, but only a byte
is written into it. Bit 24-25 are supposed to be the resolution, bit 25-26
set to 0 enable the watchdog. Bit 7 is supposed to enable MMIO decoding.
This is from AMD Publication 52740. So something in the existing code
is (or seems to be) wrong, but either case I don't see how setting bit 7
(or 31 ?) would enable the watchdog hardware.
Hmm, I wrote that code. Guess I'll need to to spend some time figuring out
what is going on.
Guenter
> break;
> }
> }
>
> Does anyone have an idea if such unconditional setting could be
> problematic on older/different efch? We probe for that bit in
> sp5100_tco_setupdevice but we never set it so far.
>
> I'm missing specs...
>
> Thanks,
> Jan
>
next prev parent reply other threads:[~2020-09-07 15:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-07 11:20 Jan Kiszka
2020-09-07 15:31 ` Guenter Roeck [this message]
2020-09-07 15:46 ` Jan Kiszka
2020-09-07 19:18 ` Guenter Roeck
2020-09-07 20:45 ` Guenter Roeck
2020-09-09 16:04 ` Guenter Roeck
2020-09-10 6:09 ` Jan Kiszka
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=f7e3233b-97e4-1f25-e18e-edb39ca86ce9@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Arsalan_Awan@mentor.com \
--cc=Cedric_Hombourger@mentor.com \
--cc=jan.kiszka@siemens.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=wade_farnsworth@mentor.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
all inboxes | Powered by JetHome®