Add reset watchdog

Although CS has been pretty reliable for me, I recently experienced
a lockup in the middle of a remote debugging session. And I really
mean *very* remote, without a living (or dead) soul able to pull
the plug on the damn thing.

So while I know there is an annoying bug hiding somewhere, I also
think the device should be able to get back to a sane state on its
own.

So let's add a watchdog and a timer. The timer kicks the watchdog
every second, and the watchdog will reset the pico after 5s without
kicking. To test the feature, there is a "^\" command available
in debug mode that will crash the CS, leading to a reset after 5s.

The default conserver configuration is to reconnect after a minute,
which seems to be good enough for my use cases. Other console SW
probably have something similar.

Signed-off-by: Marc Zyngier <maz@kernel.org>
2 files changed