[U-Boot] [PATCH 3/3] dt: bcm63158: watchdog should use a 50Mhz clock
Philippe REYNES
philippe.reynes at softathome.com
Mon May 6 13:59:08 UTC 2019
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 at 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
More information about the U-Boot
mailing list