Am 31.10.2020 um 08:17 schrieb H. Nikolaus Schaller hns@goldelico.com:
Am 31.10.2020 um 08:15 schrieb H. Nikolaus Schaller hns@goldelico.com:
Am 31.10.2020 um 07:51 schrieb H. Nikolaus Schaller hns@goldelico.com:
Hi,
Am 31.10.2020 um 03:09 schrieb Michael Mrozek EvilDragon@openpandora.org:
Hi,
daveshah mentioned on IRC that the PALMAS has a watchdog that can reset the system in case the OMAP5 does a lock up.
Yes, I think it should be enabled.
Apparently, it was enabled on an older kernel or bootloader TI released for the uEVM, but it's not enabled in our current setup.
The problem is: In case the OMAP5 locks up, it can run at full power and run REALLY hot - which could damage the battery.
Does anyone know how to enable that watchdog?
It appears as if the ti,palmas-wdt driver did not arrive in mainline:
patch 4/12 and 5/12 apply cleanly on v3.7 so we can think about forward-porting them.
If my memory would be better, I had remembered that we already have that:
https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/letux/...
But it seems to be broken and not enabled.
Now after becoming awake, I start to remember some more details and I have hacked the Letux kernel code a little...
1. the WDT was originally enabled by default in U-Boot
If I remember correctly our first experiments >5 years ago, this has the negative effect that after entering the u-boot console you just have 1 minute to type commands. So I think we have a patch in u-boot to disable it.
2. the driver requires a "compatible" entry which is missing I have added one to omap5-board-common.dtsi. See attached patch.
3. The discussion on https://lore.kernel.org/patchwork/patch/367819/ was the last step on this driver and it appears that nobody followed up.
I had taken some of the review comments and think I have fixed it:
https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/letux/...
So this series seems to be the newest code that exists for this topic.
4. enable CONFIG_PALMAS_WATCHDOG=y in the defconfig
Then the watchdog driver becomes available to the kernel - but seems to have not enabled:
root@letux:~# ls -l /sys/class/watchdog/ total 0 lrwxrwxrwx 1 root root 0 Oct 31 11:21 watchdog0 -> ../../devices/platform/44000000.ocp/4ae00000.interconnect/4ae00000.interconnect:segment@10000/4ae14000.target-module/4ae14000.wdt/watchdog/watchdog0 lrwxrwxrwx 1 root root 0 Oct 31 11:21 watchdog1 -> ../../devices/platform/44000000.ocp/48000000.interconnect/48000000.interconnect:segment@0/48070000.target-module/48070000.i2c/i2c-0/0-0048/48070000.i2c:palmas@48:watchdog/watchdog/watchdog1 root@letux:~# ls -l /sys/class/watchdog/watchdog1/ total 0 -r--r--r-- 1 root root 4096 Oct 31 11:23 dev lrwxrwxrwx 1 root root 0 Oct 31 11:23 device -> ../../../48070000.i2c:palmas@48:watchdog drwxr-xr-x 2 root root 0 Oct 31 11:23 power lrwxrwxrwx 1 root root 0 Oct 31 11:21 subsystem -> ../../../../../../../../../../../../class/watchdog -rw-r--r-- 1 root root 4096 Oct 31 11:21 uevent root@letux:~#
5. I do not know how to control the watchdog1 timeout (struct watchdog_device) from user-space and how enable the watchdog1. This has to be evaluated how it should work.
6. Note that there is also an OMAP watchdog0:
[ 4.023269] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
which raises the question why it is not sufficient in an OMAP5 lockup situation. Maybe the lockup also stops the watchdog clock or the action that should be taken after timeout.
7. there would also be a bq24297 watchdog in the Pyra, but this is doing something else. It can not shut down power to the Palmas or OMAP5 after timeout but does a self-reset of the charger chip.
Hope this helps as a quick start.
Please let me know if someone can make use of it or finds additional patches so that we can integrate them into older kernel trees (4.19, 5.4, 5.9) as well.
BR, Nikolaus