Looking at NetBSD on Ampere eMAG dmesg I noticed sbsawdt0… and decided that we need this :)
sbsawdt0: <ARM SBSA Generic Watchdog> iomem 0xf0600000-0xf0600fff,0xf0610000-0xf0610fff on acpi0 sbsawdt0: default watchdog period is 172 seconds
Differential D20974
Port sbsawdt (ARM SBSA generic watchdog) driver from NetBSD val_packett.cool on Jul 16 2019, 6:39 PM. Authored by Tags Referenced Files
Details Looking at NetBSD on Ampere eMAG dmesg I noticed sbsawdt0… and decided that we need this :) sbsawdt0: <ARM SBSA Generic Watchdog> iomem 0xf0600000-0xf0600fff,0xf0610000-0xf0610fff on acpi0 sbsawdt0: default watchdog period is 172 seconds Tested on: Marvell MACCHIATObin (Armada8k) with upstream EDK2 firmware
Diff Detail
Event TimelineComment Actions @greg_unrelenting.technology do you have a git repo available with your work in it? It'd be slightly easier for me to just add your repo and grab changes directly. Comment Actions https://github.com/myfreeweb/freebsd — I don't always update it before posting on phab but right now it's up to date Comment Actions I can confirm this attaches on my eMAG but I cannot verify the watchdog functionality - were you able to test it? Comment Actions Yeah, I couldn't get it to trip on the eMAG at Packet either, but it works on my MACCHIATObin (dropping to debugger with "watchdog timeout" description on the first interrupt and then rebooting after some more time). Would be nice to test on ThunderX2 :) Comment Actions oh.. https://www.mail-archive.com/kernel-packages@lists.launchpad.net/msg272248.html I guess we don't have any more platforms to test.. Comment Actions Can you show a diff of the NetBSD version to this? i.e. what you had to change in the port? Comment Actions ACPI attachment is different (because API is different) and I changed bus_space_map / bus_space_write_4 / etc to bus_alloc_resource / bus_write_4 / etc because we have resources and setting them via BUS_SET_RESOURCE when walking the ACPI table is rather convenient. The part that touches the device (in sbsawdt_acpi_watchdog_fn) is pretty much the same (that function is only adapted to our watchdog API which calls one function with a cmd). The original is https://github.com/NetBSD/src/blob/trunk/sys/arch/arm/acpi/sbsawdt_acpi.c — a true diff would show most things (except the defines) as different, it's better to just visually compare :) Comment Actions Thanks; my interest is really just in being able to track the version you started from, so we can review and manually apply any future changes/bug fixes from NetBSD. Maybe just add a comment along the lines of "Obtained from NetBSD sbsawdt_acpi.c r1.1" or such. Comment Actions SBSA watchdog should work on ThunderX2, the specific issue was due to the linux driver not handling the full spec. Comment Actions But the firmware version I have here does not even expose it so I cannot test on FreeBSD. Is there a known-good firmware version I should install?
|