public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Philippe REYNES <philippe.reynes@softathome.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] dt: bcm63158: watchdog should use a 50Mhz clock
Date: Mon, 6 May 2019 15:59:08 +0200 (CEST)	[thread overview]
Message-ID: <2139308689.1084379.1557151148061.JavaMail.zimbra@softathome.com> (raw)
In-Reply-To: <dc9c93cb-ecfa-9191-0297-de3691acfa1d@denx.de>

Hi Stefan,

> Hi Philippe,
> 
> On 06.05.19 14:38, Philippe REYNES wrote:
>> Hi Stefan,
>> 
>>> On 03.05.19 19:43, Philippe Reynes wrote:
>>>> The watchdog should use a clock at 50 Mhz, so
>>>> instead of using the clock osc (200 Mhz), we
>>>> define a reference clock at 50Mhz and use it
>>>> for both watchdog.
>>>> 
>>>> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
>>> 
>>> Just curious: Why is this the case? Is this also what's done in
>>> the Linux DT version?
>> 
>> From my understanding, in the linux kernel, the driver doesn't compute
>> the timeout for the watchdog counter register. Every second, the driver
>> set the maximum value in the watchdog counter register and compute a
>> logical tick. If this tick decrease below zero, the watchdog isn't
>> restarted, so when the watchdog counter reach zero, the board is resetted.
>> 
>> In u-boot, the driver compute the expected timeout and set it
>> in the watchdog register.
> 
> I see. But why "should the watchdog use a clock at 50MHz" instead of
> the default 200MHz (from your commit text)?

In the patch "fix bcm6345 watchdog on broadcom board", I've updated the
watchdog driver for bcm6345 to compute the number of tick for the counter
in the watchdog. For this computation, I need the frequency of the clock
used by the watchdog. As this IP is used on many SoC (mips, arm), I've
added a clock in the device tree so it's could be more generic.

> I'm checking as this change most likely results in a DT difference in
> the U-Boot vs the Linux version, which should be avoided.

> Thanks,
> Stefan

Regards,
Philippe

  reply	other threads:[~2019-05-06 13:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03 17:43 [U-Boot] [PATCH 0/3] fix bcm6345 watchdog on broadcom board Philippe Reynes
2019-05-03 17:43 ` [U-Boot] [PATCH 1/3] watchdog: bcm6345: callback start use tick instead of ms Philippe Reynes
2019-05-06  7:33   ` Stefan Roese
2019-05-19 20:45   ` Tom Rini
2019-05-03 17:43 ` [U-Boot] [PATCH 2/3] dt: bcm6858: watchdog should use a 50Mhz clock Philippe Reynes
2019-05-06  7:44   ` Stefan Roese
2019-05-19 20:45   ` Tom Rini
2019-05-03 17:43 ` [U-Boot] [PATCH 3/3] dt: bcm63158: " Philippe Reynes
2019-05-06  7:45   ` Stefan Roese
2019-05-06 12:38     ` Philippe REYNES
2019-05-06 12:50       ` Stefan Roese
2019-05-06 13:59         ` Philippe REYNES [this message]
2019-05-19 20:45   ` Tom Rini

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=2139308689.1084379.1557151148061.JavaMail.zimbra@softathome.com \
    --to=philippe.reynes@softathome.com \
    --cc=u-boot@lists.denx.de \
    /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