Re: [PATCH 2/2] watchdog: Add Nuvoton NPCM watchdog driver

From: Joel Stanley
Date: Mon Mar 05 2018 - 00:42:33 EST


On Fri, Mar 2, 2018 at 9:50 PM, Marcus Folkesson
<marcus.folkesson@xxxxxxxxx> wrote:
> Hello Joel!
>
> On Fri, Mar 02, 2018 at 05:07:46PM +1030, Joel Stanley wrote:
>> The Nuvoton NPCM750 has a watchdog implemented as a single register
>> inside the timer peripheral.
>>
>> This driver exposes that watchdog as a standard watchdog device with
>> coarse timeout intervals, limited by the combination of prescaler and
>> counter that is provided by the hardware. The calculation is taken from
>> the Nuvoton vendor tree.
>>
>> There is a pre-timeout IRQ that is wired up. This timeout always occurs
>> 1024 clocks before the timeout.
>>
>> Signed-off-by: Joel Stanley <joel@xxxxxxxxx>
>> ---
>> drivers/watchdog/Kconfig | 11 +++
>> drivers/watchdog/Makefile | 1 +
>> drivers/watchdog/npcm_wdt.c | 223 ++++++++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 235 insertions(+)
>> create mode 100644 drivers/watchdog/npcm_wdt.c
>>
>> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
>> index aff773bcebdb..0c1cc68894e6 100644
>> --- a/drivers/watchdog/Kconfig
>> +++ b/drivers/watchdog/Kconfig
>> @@ -513,6 +513,17 @@ config COH901327_WATCHDOG
>> This watchdog is used to reset the system and thus cannot be
>> compiled as a module.
>>
>> +config NPCM7XX_WATCHDOG
>> + bool "NPCM750 watchdog"
>
> Just asking, we do not want to make it possible to build this as a module?

The watchdog provides the SoC with a way to reboot itself, so I would
expect all users of the kernel to have it built in in case the system
cannot find it's initrd or root file system, and therefore is unable
to load the watchdog module.

I am happy to change it if you would prefer.

Thanks for the review.

Cheers,

Joel