I tried to use the watchdog with vim3 and mainline kernel and the patch works.
I added:
File meson-g12-common.dtsi under soc
amlwatchdog: amlogic-watchdog {
compatible = “amlogic,meson-gxbb-wdt”;
status = “disabled”;
reg = <0x0 0xffd0f0d0 0x0 0x10>;
clocks = <&xtal>;
};
and
File meson-g12b-a311d-khadas-vim3.dts at the end
&amlwatchdog {
status = “okay”;
};
The Kernel Module was already activated in 0.9.4
CONFIG_MESON_GXBB_WATCHDOG=y
CONFIG_MESON_WATCHDOG=y
After enabling service watchdog, it works. have a look here.
root@Khadas:~# service watchdog status
● watchdog.service - watchdog daemon
Loaded: loaded (/lib/systemd/system/watchdog.service; enabled; vendor preset:
Active: active (running) since Thu 2020-09-24 15:25:34 CEST; 7s ago
Process: 2731 ExecStartPre=/bin/sh -c [ -z “${watchdog_module}” ] || [ "${watc
Process: 2732 ExecStart=/bin/sh -c [ $run_watchdog != 1 ] || exec /usr/sbin/wa
Main PID: 2734 (watchdog)
Tasks: 1 (limit: 3573)
Memory: 628.0K
CGroup: /system.slice/watchdog.service
└─2734 /usr/sbin/watchdog -s -v -c /etc/watchdog.conf
Sep 24 15:25:37 Khadas watchdog[2734]: still alive after 3 interval(s)
Sep 24 15:25:37 Khadas watchdog[2734]: was able to ping process 1917 (/var/run/c
Sep 24 15:25:38 Khadas watchdog[2734]: still alive after 4 interval(s)
Sep 24 15:25:39 Khadas watchdog[2734]: was able to ping process 1917 (/var/run/c
Sep 24 15:25:40 Khadas watchdog[2734]: still alive after 5 interval(s)
Sep 24 15:25:40 Khadas watchdog[2734]: was able to ping process 1917 (/var/run/c
Sep 24 15:25:41 Khadas watchdog[2734]: still alive after 6 interval(s)
Sep 24 15:25:41 Khadas watchdog[2734]: was able to ping process 1917 (/var/run/c
Sep 24 15:25:42 Khadas watchdog[2734]: still alive after 7 interval(s)
Sep 24 15:25:42 Khadas watchdog[2734]: was able to ping process 1917 (/var/run/c
root@Khadas:~# echo c > /proc/sysrq-trigger
[ 470.213191] sysrq: Trigger a crash
[ 470.213269] Kernel panic - not syncing: sysrq triggered crash
[ 470.216717] SMP: stopping secondary CPUs
[ 470.220599] Kernel Offset: disabled
[ 470.224045] CPU features: 0x080002,20002004
[ 470.228183] Memory Limit: none
[ 470.231207] —[ end Kernel panic - not syncing: sysrq triggered crash ]—
G12B:BL:6e7c85:2a3b91;FEAT:E0F83180:402000;POC:F;RCY:0;EMMC:0;READ:0;0.▒!,K▒▒х▒▒}▒▒▒с0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0x01
bl2_stage_init 0xc1
bl2_stage_init 0x02
L0:00000000
L1:20000703
L2:00008067
L3:14000000
B2:00402000
B1:e0f83180
TE: 306839
BL2 Built : 15:22:05, Aug 28 2019. g12b g1bf2b53 - luan.yuan@droid15-sz
Could someone add this to the mainline kernel.
Thank you
Regards Andreas