Repository navigation
xiongmai: the kernel's sp805_wdt for /dev/watchdog, in place of xm_wdt.ko - #2644
Conversation
…t.ko XM510 and XM530/XM550 had only the vendor xm_wdt.ko: /dev/wdt, private ioctls, no write() feeding and no magic close, so busybox watchdog and sysupgrade's watchdog keeper could not drive it. It also counted from insmod, not from open (#743), and on XM510 it was not loaded at all. The watchdog is an ARM SP805, and OpenIPC/linux now registers it on both SoCs (OpenIPC/linux#128, #129). Enable CONFIG_WATCHDOG and CONFIG_ARM_SP805_WATCHDOG in both kernel configs, so the stock sp805_wdt gives /dev/watchdog: write() feeding, WDIOC_*, magic close, idle until opened. Stop shipping and loading xm_wdt.ko: it registers the same misc minor and can no longer load beside it. sysupgrade's WDOG default, /dev/watchdog, now exists on XM, so its pre-flash report and RAM-phase keeper work there unchanged. Closes #2611.
PR Summary by QodoUse the kernel SP805 watchdog on XM510 and XM530
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
1. XM530 watchdog lacks hardware proof
|
Problem
#2611. On XM510 and XM530/XM550 the only watchdog driver was the vendor
xm_wdt.ko:/dev/wdtwith private ioctls (_IO('W', 2)to feed), nowrite()and no magic close. busyboxwatchdogand sysupgrade's RAM-phase keeper couldn't drive it. sysupgrade looked for/dev/watchdog, found nothing, and reportedWatchdog: none.insmod, not at open (XM530 reboots after ~ 1 minute #743).load_xiongmaihas it commented out, so XM510 cameras ran with no watchdog at all.Change
The watchdog is an ARM SP805 at
0x20060000(ID0x00141805, read on both lab boards). OpenIPC/linux now registers it on both kernels (OpenIPC/linux#128 for xm530, #129 for xm510).br-ext-chip-xiongmai/board/xm530/xm530.generic.configandxm510/xm510.generic.configenableCONFIG_WATCHDOGandCONFIG_ARM_SP805_WATCHDOG(plusCONFIG_WATCHDOG_COREon 3.10). The block is copied from the kernel's resolved.config. The stocksp805_wdtthen gives/dev/watchdogwithwrite()feeding,WDIOC_*and magic close, idle until opened.xm_wdt.ko: removed from both osdrv packages, along with itsinsmod/rmmodinload_xiongmai(xm530, xm510) andloadxm510_64M. It registers the same misc minor (130), so it can't load besidesp805_wdtanyway.WDOG=/dev/watchdogdefault now exists on XM, so the pre-flash report and the keeper work there.Order with majestic. majestic reaches an image as the
majestic.<family>.<variant>.mastertarball current at build time, so the two changes must land in this order, both before the same nightly:/dev/watchdog(the follow-up PR) right after it.The reverse order would be unsafe: that majestic in an image that still loads
xm_wdt.ko(counting from insmod, 60 s) would leave it unfed, and XM530 would reboot in a loop.Between the two: current majestic opens
/dev/wdton XM. On an image with this change it logsWatchdog device (/dev/wdt) not foundand runs with no watchdog until majestic's XM watchdog code switches to/dev/watchdog(follow-up PR in majestic). The SP805 stays idle until opened, so nothing resets the camera in between. Mixed updates are safe too:xm_wdt.kofails to load (minor taken), and the SP805 stays idle;Hardware tested on
xm530_liteimage (the camera runs an xm530 build), installed withsysupgrade -z --kernel=... --rootfs=..., overlay kept. The pre-upgrade kernel and rootfs partitions are backed up.xm510_litebuild (uImage.xm510, from the merged OpenIPC/linux tarball), TFTP-booted into RAM from U-Boot with the board's flashed rootfs. Nothing was written to flash.Evidence
XM550, before (its previous xm530 build):
XM550, after (this branch's image):
XM510, before (stock kernel):
XM510, after (this build's kernel):
Earlier, on the same kernel change (OpenIPC/linux#129), on the same board:
Images:
Checks:
STRICT=1 test_shell_parse.sh: clean.STRICT=1 test_strip_shell_comments.sh: clean.ci-matrix.py --self-test: ok.ci-matrix.py --stdinselectsxm510_liteandxm530_lite.Scope
general/package/all-patches/linux/(those go to OpenIPC/linux)general/overlay/or in a sharedload_<vendor>script hardcodes a value specific to my boardLD_PRELOAD, and no binaries that cannot be rebuilt from source