-   Linux - Embedded & Single-board computer (
-   -   help writing watchdog timer driver (

sallu.salmankhalid 08-02-2013 01:46 AM

help writing watchdog timer driver

After successfuly learning how to crosscompile linux kernel and application for embedded devices I am learning device driver development and I want to write watchdog driver for my pandaboard running linux but I have no idea where to start. I have written linux kernel modules so I know how to write a basic character driver but I am not able to find any reference material for writing watchdog timer device driver for omap4. Please point me in the right direction and if possible give me links to concerned reference material.


onebuck 08-03-2013 08:25 AM

Member Response

Linux does provide a watchdog timer.
The following is dated but can be used for references. Look at the kernel version you are wishing to work with to get better detail.

Look at & watchdog-api.txt

The Linux Watchdog driver API.
6 Copyright 2002 Christer Weingel <>
8 Some parts of this document are copied verbatim from the sbc60xxwdt
9 driver which is (c) Copyright 2000 Jakob Oestergaard <>
11 This document describes the state of the Linux 2.4.18 kernel.
13 Introduction:
15 A Watchdog Timer (WDT) is a hardware circuit that can reset the
16 computer system in case of a software fault. You probably knew that
17 already.
19 Usually a userspace daemon will notify the kernel watchdog driver via the
20 /dev/watchdog special device file that userspace is still alive, at
21 regular intervals. When such a notification occurs, the driver will
22 usually tell the hardware watchdog that everything is in order, and
23 that the watchdog should wait for yet another little while to reset
24 the system. If userspace fails (RAM error, kernel bug, whatever), the
25 notifications cease to occur, and the hardware watchdog will reset the
26 system (causing a reboot) after the timeout occurs..
These two links should be of help;

Hope this helps.

sallu.salmankhalid 08-05-2013 01:51 AM

Thanks alot for replying

I am learning how to write my own device driver from scratch. I have reference manual for omap4 watchdog timer but I dont know how to start writing my own device driver. The reference manual has a lot of register that need to be configured to make watchdog driver operational but I have no idea how to do that. The file watchdog-apt.txt & watchdog-simple.c discuss the userspace application, not how to write your own device driver. The "The Linux WatchDog Timer Driver Core kernel API" was quite helpfull but I am still lost. If you could point me in the right direction that will be very helpful.


All times are GMT -5. The time now is 12:56 AM.