Page MenuHomeFreeBSD

Add a driver for the TI watchdog.

Authored by rpaulo on Oct 18 2014, 7:46 AM.


Group Reviewers
rS273257: Add a driver for the TI watchdog.

The TI watchdog timer is present on BeagleBone's. Since 2014, U-Boot
has been booting the BeagleBone with the watchdog enabled. We need to
disable it on boot to avoid a spurious reset.
The timer isn't exactly precise, but it will do as a watchdog. This
is also a reflection of the watchdog(9) API.

In the future, we could handle interrupts, but the watchdog(9) API
needs to be a bit smarter before that can happen.

Test Plan

Booted the BBB with a new U-Boot and confirmed it survives more than
one minute.
Used watchdog and watchdog to test the code.

Diff Detail

rS FreeBSD src repository - subversion
Lint Skipped
Unit Tests Skipped

Event Timeline

rpaulo retitled this revision from to Add a driver for the TI watchdog..
rpaulo updated this object.
rpaulo edited the test plan for this revision. (Show Details)
andrew added inline comments.
22 ↗(On Diff #2030)

I think this should be optional, with the above warning in the kernel config.

126 ↗(On Diff #2030)

What do these magic numbers mean? Are they just values the user manual says we need to write to the register?

148 ↗(On Diff #2030)

This should handle "ti,omap3-wdt" as that is what Linux uses.

126 ↗(On Diff #2030)

Yes. I suspect it's a sequence to avoid enabling/disabling the watchdog accidentally.

Changes based on review comments.

Fixing the previous revision.

Fixing the compatible string.

andrew added a reviewer: andrew.
This revision is now accepted and ready to land.Oct 18 2014, 4:49 PM
rpaulo updated this revision to Diff 2040.

Closed by commit rS273257 (authored by @rpaulo).

stas added inline comments.

Missing blank line. It looks like you're using style(9) like blank lines in ti_wdt_enable(), but not here and not in some other functions.