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
Lint Skipped
Unit Tests Skipped

Event Timeline

rpaulo updated this revision to Diff 2030.Oct 18 2014, 7:46 AM
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)
rpaulo added a reviewer: ARM.Oct 18 2014, 7:47 AM
andrew added a subscriber: andrew.Oct 18 2014, 10:36 AM
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.

rpaulo added inline comments.Oct 18 2014, 4:29 PM
126 ↗(On Diff #2030)

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

rpaulo updated this revision to Diff 2037.Oct 18 2014, 4:37 PM

Changes based on review comments.

rpaulo updated this revision to Diff 2038.Oct 18 2014, 4:37 PM

Fixing the previous revision.

rpaulo updated this revision to Diff 2039.Oct 18 2014, 4:39 PM

Fixing the compatible string.

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

Closed by commit rS273257 (authored by @rpaulo).

stas added a subscriber: stas.Oct 18 2014, 11:47 PM
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.