Re: [PATCH 2/2] watchdog: Add Apple SoC watchdog driver

From: Sven Peter
Date: Thu Dec 02 2021 - 06:06:08 EST




On Thu, Dec 2, 2021, at 06:14, Hector Martin wrote:
> On 14/11/2021 22.18, Alyssa Rosenzweig wrote:
>>>>> + * This HW block has three separate watchdogs. WD0 resets the machine
>>>>> + * to recovery mode and is not very useful for us. WD1 and WD2 trigger a normal
>>>>> + * machine reset. WD0 additionally supports a configurable interrupt.
>>>>
>>>> Do we have any idea what the difference between WD1 and WD2 is?
>>>
>>> I've never seen macOS write to WD2 when running in our hypervisor and only
>>> found that one when I was looking at the rest of the MMIO region.
>>> >From what I can tell it works exactly like WD1.
>>
>> Makes sense, thanks.
>>
>
> Are any of these watchdogs active when we boot, and are we leaving them
> like that? I'm pretty sure at least some of the coprocessors have their
> own watchdog (SMC...), which might be one of these. We should make sure
> we don't clobber that.

That's what I thought at first as well but they are all disabled except for
WD1 which we disable in m1n1.
I don't touch WD0 or WD2 in this driver anyway and v2 also checks if WD1 is
running (because it might've been started by u-boot) and makes sure the
watchdog core is aware and keeps pinging it.


Sven