Not really a beginners subject but I think I have succeeded...|
The watchdog for A20 is not enabled in the kernel configuration. It is only enabled for sun4i ad sun5i devices although the same code would be working for sun7i (A20). To have the option showing in the kernel's menuconfig you have to modify drivers/watchdog/Kconfig so that the "sunxi" section looks like this:
Then in menuconfig's "Device Drivers/Watchdog Timer Support" enable Allwinner A10/A13/A20 Watchdog as a module. You must have "Watchdog Timer Driver core" enabled first Copy the Code
- config SUNXI_WDT
- tristate "Allwinner A10/A13/A20 Watchdog"
- depends on ARCH_SUN4I || ARCH_SUN5I || ARCH_SUN7I
- This is the driver for the hardware watchdog on the Allwinner
- A10/A13/A20 processors.
- If you have one of these processors and wish to have
- watchdog support enabled, say Y, otherwise say N.
- To compile this driver as a module, choose M here: the
- module will be called sunxi_wdt.
This will compile sunxi_wdt module and create kernel/drivers/watchdog/sunxi_wdt.ko in the modules library.
Now to have it working on your Banana-Pi you have to tell it to load the module by adding "sunxi_wdt" at the bottom of the /etc/modules file
You can load it immediately with sudo modprobe sunxi_wdt. It will create the device /dev/watchdog.
You also need to install the watchdog daemon:
sudo apt-get install sysv-rc <- this one should be already installed
sudo apt-get install watchdog
Then in /etc/watchdog.conf
watchdog-timeout=20 (time in seconds before the watchdog resets the system after unresponsive attempt )
How did I try this:
well unfortunately my system goes into kernel panic whenever the memory is under too much stress (well at least I think so). I use an application called dvblast that is quite good at putting the kernel into panic after a while. Before enabling the watchdog the Banana just stopped waiting for me to hard reset it. Now I could verify that it restarts by itself in the same situation.