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 14:38:56 +0200 (CEST) [thread overview]
Message-ID: <1228437757.864853.1557146336933.JavaMail.zimbra@softathome.com> (raw)
In-Reply-To: <b2829b32-37d8-7c95-1ee6-a1c1be7b6622@denx.de>
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.
> Other than that:
>
> Reviewed-by: Stefan Roese <sr@denx.de>
Thanks
> Thanks,
> Stefan
Regards,
Philippe
>
>> ---
>> arch/arm/dts/bcm63158.dtsi | 10 ++++++++--
>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/dts/bcm63158.dtsi b/arch/arm/dts/bcm63158.dtsi
>> index 4b2eaee..175af38 100644
>> --- a/arch/arm/dts/bcm63158.dtsi
>> +++ b/arch/arm/dts/bcm63158.dtsi
>> @@ -66,6 +66,12 @@
>> clock-frequency = <0xbebc200>;
>> u-boot,dm-pre-reloc;
>> };
>> +
>> + refclk50mhz: refclk50mhz {
>> + compatible = "fixed-clock";
>> + #clock-cells = <0>;
>> + clock-frequency = <50000000>;
>> + };
>> };
>>
>> ubus {
>> @@ -92,13 +98,13 @@
>> wdt1: watchdog at ff800480 {
>> compatible = "brcm,bcm6345-wdt";
>> reg = <0x0 0xff800480 0x0 0x14>;
>> - clocks = <&periph_osc>;
>> + clocks = <&refclk50mhz>;
>> };
>>
>> wdt2: watchdog at ff8004c0 {
>> compatible = "brcm,bcm6345-wdt";
>> reg = <0x0 0xff8004c0 0x0 0x14>;
>> - clocks = <&periph_osc>;
>> + clocks = <&refclk50mhz>;
>> };
>>
>> wdt-reboot {
>>
>
> Viele Grüße,
> Stefan
>
> --
> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
next prev parent reply other threads:[~2019-05-06 12:38 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 [this message]
2019-05-06 12:50 ` Stefan Roese
2019-05-06 13:59 ` Philippe REYNES
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=1228437757.864853.1557146336933.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